diff --git a/data/definitions/animations.yml b/data/definitions/animations.yml index eb0bf7915..cf42245b1 100644 --- a/data/definitions/animations.yml +++ b/data/definitions/animations.yml @@ -1,4 +1,7 @@ # Dialogue expressions + +expression_unknown_expression: 9807 + expression_no: 9740 expression_yes: 9741 expression_amazed1: 9742 @@ -1624,4 +1627,5 @@ teleport_jewellery: teleport_pharaohs_sceptre: id: 9596 ticks: 3 -fill_bucket: 895 \ No newline at end of file +fill_bucket: 895 +engrave: 14736 \ No newline at end of file diff --git a/data/definitions/interfaces.yml b/data/definitions/interfaces.yml index f5bb37b51..b7a33dc1c 100644 --- a/data/definitions/interfaces.yml +++ b/data/definitions/interfaces.yml @@ -226,6 +226,12 @@ inventory: Option12: 17 Drag: 20 Option13: 21 +messagescrol: + id: 156 + type: wide_screen + components: + title: 5 + line0: 7-106 slayer_rewards_assignment: 161 slayer_rewards_learn_old: 163 slayer_rewards: 164 diff --git a/data/definitions/npcs.yml b/data/definitions/npcs.yml index 7f36a4703..0c3beed79 100644 --- a/data/definitions/npcs.yml +++ b/data/definitions/npcs.yml @@ -409,6 +409,11 @@ squire_asrol: race: human wander_radius: 4 examine: "Indentured servant of a Knight." +jeffery: + id: 637 + wander_radius: 4 + race: human + examine: "The man with the armour." reldo: id: 647 wander_radius: 4 @@ -595,6 +600,10 @@ banker_canifis: interact_distance: 2 race: human examine: "He can look after my money." +dororan: + id: 1168 + race: dwarf + examine: "A dwarf in anguish." yrsa: id: 1301 race: human @@ -674,6 +683,19 @@ quiz_master: interact_distance: 4 race: human examine: "Apparently a master of quizzes!" +dororan_after_cutscene: + id: 2646 +dororan_after_cutscene2: + id: 2647 + examine: "A dwarf on top of the world." +dororan_after_quest: + &dororan_after_quest + id: 2648 + race: dwarf + examine: "A dwarf on top of the world." +dororan_after_quest2: + <<: *dororan_after_quest + id: 2651 reldo_normal: id: 2661 race: human @@ -709,6 +731,58 @@ ellis: id: 2824 race: human examine: "Manufacturer of fine leathers." +dororan_cutscene: + id: 2863 + examine: "A dwarf in suspense." +gudrun: + &gudrun + id: 2864 + wander_radius: 4 + race: human + examine: "The chieftain's daughter." +gudrun2: + <<: *gudrun + id: 2865 +gudrun_after_cutscene: + <<: *gudrun + id: 2866 +gudrun_after_cutscene2: + <<: *gudrun + id: 2867 +gudrun_after_quest: + <<: *gudrun + id: 2869 +gudrun_after_quest2: + <<: *gudrun + id: 2870 +gudrun_cutscene: + <<: *gudrun + id: 2871 +kjell: + &kjell + id: 2872 + race: human + examine: "A barbarian guard." +kjell_sword: + <<: *kjell + id: 2873 +kjell_guitar: + <<: *kjell + id: 2874 +kjell_cutscene: + id: 2875 + examine: "A barbarian guard." +chieftain_gunthor: + &chieftain_gunthor + id: 2876 + race: human + examine: "A heavily built barbarian with an air of power and authority." +chieftain_gunthor_icon: + <<: *chieftain_gunthor + id: 2877 +chieftain_gunthort_no_icon: + <<: *chieftain_gunthor + id: 2878 rat_ratcatchers: id: 2974 wander_radius: 4 @@ -731,6 +805,22 @@ rat_ratcatchers_7: id: 2980 wander_radius: 4 examine: "A popular dwarven delicacy." +chieftain_gunthor_cutscene: + id: 3089 + examine: "A heavily built barbarian with an air of power and authority." +haakon_the_champion: + id: 3090 + max_hit_melee: 42 + hitpoints: 360 + immune_poison: true + wander_radius: 4 + respawn_delay: 75 + style: crush + race: human + examine: "A mighty warrior, Haakon is powerfully concerned for his tribe." +haakon_the_champion_cutscene: + id: 3091 + examine: "A mighty warrior, Haakon is powerfully concerned for his tribe." prison_pete: id: 3118 examine: "He wants to escape!" @@ -767,6 +857,11 @@ frog_9_frogland: cow_zanaris: <<: *cow id: 3309 +jeffery3: + id: 3323 + wander_radius: 4 + race: human + examine: "The man with the armour." tarquin: id: 3328 examine: "A dandy canoe man." @@ -1109,6 +1204,11 @@ fishing_spot_crayfish_lumbridge: none: - raw_crayfish examine: "It looks like there might be fish swimming in the water." +jeffery2: + id: 6298 + wander_radius: 4 + race: human + examine: "The man with the armour." pikkupstix: id: 6970 race: human diff --git a/data/definitions/variables-custom.yml b/data/definitions/variables-custom.yml index d1158998b..be0d124ce 100644 --- a/data/definitions/variables-custom.yml +++ b/data/definitions/variables-custom.yml @@ -1,3 +1,12 @@ +dororan_ruby_bracelet: + format: boolean + persist: true +dororan_dragonstone_necklace: + format: boolean + persist: true +dororan_onyx_amulet: + format: boolean + persist: true demon_slayer_bones: format: int persist: true diff --git a/data/definitions/variables-player-bit.yml b/data/definitions/variables-player-bit.yml index c34957797..ab8364eae 100644 --- a/data/definitions/variables-player-bit.yml +++ b/data/definitions/variables-player-bit.yml @@ -1,3 +1,69 @@ +gunnars_ground: + id: 5730 + persist: true + format: map + default: unstarted + values: + unstarted: 0 + started: 1 + love_poem: 2 + jeffery_ring: 3 + engrave: 4 + engraved_ring: 5 + show_gudrun: 6 + meet_chieftain: 7 + tell_gudrun: 8 + tell_dororan: 9 + write_poem: 10 + more_poem: 11 + one_more_poem: 12 + poem_done: 13 + poem: 14 + recital: 15 + gunnars_ground: 16 + completed: 100 +kjell: + id: 5819 + persist: true + format: list + default: sword + values: [ sword, guitar ] +dororan: + id: 5820 + persist: true + format: list + default: shown + values: [ shown, hidden ] +gudrun: + id: 6664 + persist: true + format: list + default: shown + values: [ shown, hidden ] +dororan_after_quest: + id: 6665 + persist: true + format: list + default: hidden + values: [ hidden, shown ] +gudrun_after_quest: + id: 6666 + persist: true + format: list + default: hidden + values: [ hidden, shown ] +dororan_after_cutscene: + id: 8242 + persist: true + format: list + default: hidden + values: [ hidden, shown ] +gudrun_after_cutscene: + id: 8243 + persist: true + format: list + default: hidden + values: [ hidden, shown ] demon_slayer: id: 2561 persist: true diff --git a/data/definitions/variables-player.yml b/data/definitions/variables-player.yml index eb8576af3..484b2a2c6 100644 --- a/data/definitions/variables-player.yml +++ b/data/definitions/variables-player.yml @@ -95,7 +95,7 @@ quest_points_total: format: map default: total values: - total: 7 + total: 12 cooks_assistant: id: 29 persist: true diff --git a/data/spawns/npc-spawns.yml b/data/spawns/npc-spawns.yml index fb436ecfa..fc913c392 100644 --- a/data/spawns/npc-spawns.yml +++ b/data/spawns/npc-spawns.yml @@ -383,6 +383,8 @@ - { id: goblin_light_grey_bald_spear, x: 2392, y: 9656 } - { id: goblin_light_grey_bald_spear, x: 2396, y: 9658 } - { id: goblin_light_grey_bald_spear, x: 2397, y: 9655 } +# 9623 +- { id: zombie, x: 2405, y: 9713, members: true } # 9772 - { id: giant_spider_2, x: 2459, y: 2864, members: true } - { id: giant_spider_2, x: 2479, y: 2866, members: true } @@ -521,6 +523,7 @@ - { id: goblin_light_grey_bald_spear, x: 2438, y: 9700 } - { id: goblin_light_grey_bald_spear, x: 2441, y: 9698 } - { id: goblin_light_grey_bald_spear, x: 2439, y: 9696 } +- { id: zombie, x: 2452, y: 9684, members: true } # 9882 - { id: rat, x: 2442, y: 9891, members: true } - { id: rat, x: 2447, y: 9891, members: true } @@ -650,10 +653,14 @@ - { id: rat, x: 2502, y: 9437, members: true } - { id: rat, x: 2501, y: 9430, members: true } - { id: rat, x: 2527, y: 9412, members: true } +# 10133 +- { id: zombie, x: 2541, y: 9569, members: true } # 10137 - { id: butterfly_1, x: 2540, y: 9820, members: true } - { id: butterfly_1, x: 2546, y: 9817, members: true } - { id: butterfly_1, x: 2543, y: 9813, members: true } +# 10137 +- { id: zombie, x: 2540, y: 9823, members: true } # 10138 - { id: rat, x: 2542, y: 9897, members: true } # 10284 @@ -1351,6 +1358,13 @@ - { id: goblin_orange_hat_spear, x: 3126, y: 3450 } - { id: goblin_orange_hat_spear, x: 3121, y: 3422 } - { id: sigurd, x: 3113, y: 3413 } +- { id: dororan_after_cutscene, x: 3083, y: 3417, direction: SOUTH } +- { id: gudrun_after_cutscene, x: 3082, y: 3417, direction: SOUTH } +- { id: dororan, x: 3098, y: 3422, direction: EAST } +- { id: gudrun, x: 3082, y: 3417 } +- { id: chieftain_gunthor, x: 3078, y: 3444 } +- { id: haakon_the_champion, x: 3081, y: 3444 } +- { id: kjell, x: 3079, y: 3414, direction: NORTH_EAST } # 12342 - { id: man, x: 3093, y: 3512 } - { id: man, x: 3097, y: 3512 } @@ -1369,6 +1383,7 @@ - { id: rat, x: 3123, y: 3487 } - { id: rat, x: 3128, y: 3485 } - { id: hari, x: 3133, y: 3509 } +- { id: jeffery, x: 3108, y: 3500 } # 12436 - { id: combat_instructor, x: 3106, y: 9509 } - { id: mining_instructor, x: 3081, y: 9504 } @@ -1634,6 +1649,8 @@ - { id: banker_4, x: 3166, y: 3489, direction: EAST } - { id: rat, x: 3151, y: 3414 } - { id: musician_cooks_guild, x: 3153, y: 3422, direction: SOUTH } +- { id: dororan_after_quest, x: 3159, y: 3434 } +- { id: gudrun_after_quest, x: 3162, y: 3434 } # 12600 - { id: goblin_musician, x: 3143, y: 3642, direction: WEST } - { id: rat, x: 3160, y: 3639 } diff --git a/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/GunnarsGround.kts b/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/GunnarsGround.kts new file mode 100644 index 000000000..9e7985631 --- /dev/null +++ b/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/GunnarsGround.kts @@ -0,0 +1,312 @@ +package world.gregs.voidps.world.activity.quest + +import world.gregs.voidps.engine.client.ui.InterfaceOption +import world.gregs.voidps.engine.entity.Registered +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.event.on +import world.gregs.voidps.engine.inv.holdsItem +import world.gregs.voidps.world.interact.entity.player.equip.InventoryOption + + +fun Player.sendScroll(name: String, lines: List) { + if (!interfaces.open("messagescrol")) { + return + } + // sendScript(1207, lines.size + 1)//todo + interfaces.sendText("messagescrol", "title", name) + interfaces.sendText("messagescrol", "line0", "") + for (i in 0..87) { + interfaces.sendText("messagescrol", "line${i + 1}", lines.getOrNull(i) ?: "") + } +} + +on { player: Player -> + player.sendVariable("gudrun_after_quest") + player.sendVariable("dororan_after_quest") + player.sendVariable("kjell") + player.sendVariable("dororan") + player.sendVariable("dororan_after_cutscene") + player.sendVariable("gudrun") + player.sendVariable("gudrun_after_cutscene") + player.sendVariable("dororan_ruby_bracelet") + player.sendVariable("dororan_dragonstone_necklace") + player.sendVariable("dororan_onyx_amulet") +} + +on({ inventory == "inventory" && item.id == "gunnars_ground" && option == "Read" }) { player: Player -> + player.sendScroll("Gunnar's Ground", listOf( + "Our people dwelt on mountains steeped in lore,", + "A mighty tribe as harsh as any beast", + "Who then, in face of madness swept to war,", + "The warlord Gunnar leading to the east.", + "", + "This legacy of honour still lives on", + "In Gunnar's bloodline, fierce to this day.", + "We sing the tales of battles long since won", + "And from his righteous purpose never stray.", + "", + "But long is gone the author of that threat", + "And even rolling boulders come to rest,", + "For Gunnar's ground is rich and fruitful yet", + "And Gunnar's blood with beauty blessed.", + "", + "Now let these freemen from this conflict cease", + "And let this be the time of Gunthor's peace." + )) +} + +on({ id == "quest_journals" && component == "journals" && itemSlot == 17 }) { player: Player -> + val lines = when (player.quest("gunnars_ground")) { + "completed" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "Gunthor was not accommodating. He told me to ask Gudrun", + "in the barbarian village what someone called Gunnar would think.", + "Gudrun suggested I see if Dororan, outside the", + "barbarian village, can think of anything to help convince Gunthor.", + "Dororan, outside the barbarian village, is going to try to write", + "a poem to convince Gunthor. I should check how he's getting on.", + "I need to take the poem to Gudrun in the barbarian village", + "and ask her to read it to her father.", + "I should talk to Gudrun or Dororan in the", + "barbarian village about how the recital went.", + "Dororan has moved into a large house, east of the", + "barbarian village and across the river. The house is north", + "of the road and has roses outside", + "", + "QUEST COMPLETE!" + ) + "gunnars_ground" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "Gunthor was not accommodating. He told me to ask Gudrun", + "in the barbarian village what someone called Gunnar would think.", + "Gudrun suggested I see if Dororan, outside the", + "barbarian village, can think of anything to help convince Gunthor.", + "Dororan, outside the barbarian village, is going to try to write", + "a poem to convince Gunthor. I should check how he's getting on.", + "I need to take the poem to Gudrun in the barbarian village", + "and ask her to read it to her father.", + "I should talk to Gudrun or Dororan in the", + "barbarian village about how the recital went." + ) + "recital" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "Gunthor was not accommodating. He told me to ask Gudrun", + "in the barbarian village what someone called Gunnar would think.", + "Gudrun suggested I see if Dororan, outside the", + "barbarian village, can think of anything to help convince Gunthor.", + "Dororan, outside the barbarian village, is going to try to write", + "a poem to convince Gunthor. I should check how he's getting on.", + "I need to take the poem to Gudrun in the barbarian village", + "and ask her to read it to her father.", + "I should talk to Gudrun in the barbarian village", + "once I'm ready for her to read the poem to her father." + ) + "poem" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "Gunthor was not accommodating. He told me to ask Gudrun", + "in the barbarian village what someone called Gunnar would think.", + "Gudrun suggested I see if Dororan, outside the", + "barbarian village, can think of anything to help convince Gunthor.", + "Dororan, outside the barbarian village, is going to try to write", + "a poem to convince Gunthor. I should check how he's getting on.", + "I need to take the poem to Gudrun in the barbarian village", + "and ask her to read it to her father." + ) + "write_poem", "more_poem", "one_more_poem", "poem_done" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "Gunthor was not accommodating. He told me to ask Gudrun", + "in the barbarian village what someone called Gunnar would think.", + "Gudrun suggested I see if Dororan, outside the", + "barbarian village, can think of anything to help convince Gunthor.", + "Dororan, outside the barbarian village, is going to try to write", + "a poem to convince Gunthor. I should check how he's getting on.", + "" + ) + "tell_dororan" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "Gunthor was not accommodating. He told me to ask Gudrun", + "in the barbarian village what someone called Gunnar would think.", + "Gudrun suggested I see if Dororan, outside the", + "barbarian village, can think of anything to help convince Gunthor.", + "" + ) + "tell_gudrun" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "Gunthor was not accommodating. He told me to ask Gudrun", + "in the barbarian village what someone called Gunnar would think.", + "" + ) + "meet_chieftain" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "Gudrun says that her father, Gunthor, would never allow her to", + "have a relationship with an outsider. She wondered if I could", + "convince him otherwise. He can be found at the longhouse in the", + "barbarian village.", + "" + ) + "show_gudrun" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan,", + "outside the barbarian village.", + "Dororan wants me to take the engraved ring to Gudrun", + "in the barbarian village", + "He asked that I not reveal that he is a dwarf just yet.", + "" + ) + "engraved_ring" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel.", + "I need to show the engraved ring to Dororan, outside", + "the barbarian village." + ) + "engrave" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan, outside the barbarian village, wants me to bring him", + "a gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Dororan wants me to engrave the words ", + "'Gudrun the Fair, Gudrun the Fiery' onto the gold ring with a chisel." + ) + "love_poem", "jeffery_ring" -> { + val list = mutableListOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village.", + "Dororan outside the barbarian village, wants me to bring him a", + "Gold ring he Specifically wants a ring from Jeffery in Edgeville.", + "Items I need:", + ) + if (player.holdsItem("ring_from_jeffery")) { + list.add("Ring from Jeffery") + } else { + list.add("Ring from Jeffery") + } + list + } + "started" -> listOf( + "I met an unhappy dwarf named Dororan just outside the", + "barbarian village." + ) + else -> listOf( + "I can start this quest by talking to Dororan, the dwarf", + "just outside the barbarian village." + ) + } + player.sendQuestJournal("Gunnar's Ground", lines) +} diff --git a/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/QuestJournals.kts b/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/QuestJournals.kts index c6a2f2d83..f9aec1389 100644 --- a/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/QuestJournals.kts +++ b/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/QuestJournals.kts @@ -14,6 +14,7 @@ val quests = setOf( "cooks_assistant", "demon_slayer", "dorics_quest", + "gunnars_ground", "the_knights_sword", "rune_mysteries" // members @@ -22,7 +23,7 @@ val quests = setOf( on({ id == "quest_journals" }) { player: Player -> player.interfaceOptions.unlock(id, "journals", 0 until 201, "View") player.sendVariable("quest_points") - player.sendVariable("quest_points_total") //set total quest points available in variables.yml + player.sendVariable("quest_points_total") //set total quest points available in variables-player.yml player.sendVariable("unstable_foundations") for (quest in quests) { player.sendVariable(quest) diff --git a/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/Quests.kts b/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/Quests.kts index 45eee3366..bb6f04b6d 100644 --- a/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/Quests.kts +++ b/game/src/main/kotlin/world/gregs/voidps/world/activity/quest/Quests.kts @@ -8,6 +8,7 @@ val quests = listOf( "cooks_assistant", "demon_slayer", "dorics_quest", + "gunnars_ground", "rune_mysteries", "the_knights_sword" ) diff --git a/game/src/main/kotlin/world/gregs/voidps/world/interact/dialogue/Expression.kt b/game/src/main/kotlin/world/gregs/voidps/world/interact/dialogue/Expression.kt index 397ff4e4f..40197906b 100644 --- a/game/src/main/kotlin/world/gregs/voidps/world/interact/dialogue/Expression.kt +++ b/game/src/main/kotlin/world/gregs/voidps/world/interact/dialogue/Expression.kt @@ -2,6 +2,8 @@ package world.gregs.voidps.world.interact.dialogue sealed class Expression +object Unknown_expression : Expression() + object Talk : Expression() object Talking : Expression() object Laugh : Expression() diff --git a/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/ChieftainGunthor.kts b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/ChieftainGunthor.kts new file mode 100644 index 000000000..618b1c59b --- /dev/null +++ b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/ChieftainGunthor.kts @@ -0,0 +1,115 @@ +package world.gregs.voidps.world.map.barbarian_village + +import world.gregs.voidps.engine.entity.character.CharacterContext +import world.gregs.voidps.engine.entity.character.npc.NPCOption +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.event.on +import world.gregs.voidps.world.activity.quest.quest +import world.gregs.voidps.world.interact.dialogue.* +import world.gregs.voidps.world.interact.dialogue.type.choice +import world.gregs.voidps.world.interact.dialogue.type.npc +import world.gregs.voidps.world.interact.dialogue.type.player + +on({ operate && target.id == "chieftain_gunthor" && option == "Talk-to" }) { player: Player -> + when (player.quest("gunnars_ground")) { + "completed" -> { + } + "tell_gudrun", "tell_dororan", "write_poem", "more_poem", "one_more_poem", "poem_done", "poem", "recital", "gunnars_ground" -> { + npc("Run back to Gudrun and tell her to remember her forefathers!") + npc("Tell her to think of Gunnar and what he would think of this insult! Now go before I have Haakon dismember you.") + seeHimTry() + } + "meet_chieftain" -> { + meetChieftain() + } + else -> unstarted() + } +} + +suspend fun CharacterContext.meetChieftain() { + npc("Begone, outerlander! Your kind are not welcome here!") + choice { + option("I need to speak with you, chieftain.") { + makeItShort() + } + option("Be quiet and listen.") { + makeItShort() + } + } +} + +suspend fun CharacterContext.makeItShort() { + npc("Make it short.") + player("Your daughter seeks permission to court an outerlander.") + npc("WHAT??") + choice { + option("Your daughter seeks permission to court an outerlander.") { + barbarians() + } + option("Are you deaf?") { + barbarians() + } + } +} + +suspend fun CharacterContext.barbarians() { + npc("Do you have ANY idea who we are?") + choice { + option("You're barbarians.") { + waitAMoment() + } + option("You're a tribe of primitives.") { + waitAMoment() + } + } +} + +suspend fun CharacterContext.waitAMoment() { + npc("We are storm that sweeps from the mountains! We are the scourge of these soft lands!") + choice { + option("Please wait a moment.") { + campOfWar() + } + option("Are you finished?") { + campOfWar() + } + } +} + +suspend fun CharacterContext.campOfWar() { + npc("We are the freemen of the ice. You think this a settlement, but it is a camp of war!") + npc("haakon_the_champion","Chieftain! May I interrupt?") + npc("What is it, Haakon?") + npc("haakon_the_champion","We have lived here since before the time of my father. Perhaps we are no longer a camp.") + npc("Your father? Do you honour him, Haakon?") + npc("haakon_the_champion","Of course!") + npc("And do you honour Warloard Gunnar?") + npc("haakon_the_champion","Of course, Chieftain!") + npc("Then why do you dishonour his name by abandoning what he fought for?") + npc("We will honour our fathers and we will honour Gunnar!") + npc("haakon_the_champion","Yes, Chieftain. You are wise. I am sorry.") + npc("You! Outerlander!") + player("What?") + npc("We are not friends, you and I! We are not allies!") + npc("Run back to Gudrun and tell her to remember her forefathers!") + player["gunnars_ground"] = "tell_gudrun" + npc("Tell her to think of Gunnar and what he would think of this insult! Now go before I have Haakon dismember you.") + seeHimTry() +} + +suspend fun CharacterContext.seeHimTry() { + choice { + option("I'm going!") { + } + option("I'd like to see him try.") { + npc("haakon_the_champion","Come here and say that to my face, outerlander!") + } + option("I'm going to challenge him right now!") { + npc("haakon_the_champion","Come here and say that to my face, outerlander!") + } + } +} + +suspend fun CharacterContext.unstarted() { + npc("Begone, outerlander! Your kind are not welcome here!") +} \ No newline at end of file diff --git a/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Dororan.kts b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Dororan.kts new file mode 100644 index 000000000..f010dca4a --- /dev/null +++ b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Dororan.kts @@ -0,0 +1,1264 @@ +package world.gregs.voidps.world.map.barbarian_village + +import world.gregs.voidps.engine.client.message +import world.gregs.voidps.engine.client.ui.interact.ItemOnItem +import world.gregs.voidps.engine.client.ui.open +import world.gregs.voidps.engine.entity.character.CharacterContext +import world.gregs.voidps.engine.entity.character.npc.NPCOption +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.entity.character.player.skill.Skill +import world.gregs.voidps.engine.entity.character.setAnimation +import world.gregs.voidps.engine.event.on +import world.gregs.voidps.engine.inv.add +import world.gregs.voidps.engine.inv.holdsItem +import world.gregs.voidps.engine.inv.inventory +import world.gregs.voidps.engine.inv.replace +import world.gregs.voidps.engine.suspend.delay +import world.gregs.voidps.world.activity.bank.ownsItem +import world.gregs.voidps.world.activity.quest.quest +import world.gregs.voidps.world.activity.quest.refreshQuestJournal +import world.gregs.voidps.world.interact.dialogue.* +import world.gregs.voidps.world.interact.dialogue.type.* + + +on({ fromItem.id == "chisel" && toItem.id == "ring_from_jeffery" }) { player: Player -> + if (player.quest("gunnars_ground") == "jeffery_ring") { + player.message("Nothing interesting happens.") + } else { + // item("dororans_engraved_ring", 400, "You engrave 'Gudrun the Fair, Gudrun the Fiery' onto the ring.")//todo fix + player.setAnimation("engrave") + player.experience.add(Skill.Crafting, 125.0) + player.inventory.replace("ring_from_jeffery", "dororans_engraved_ring") + player["gunnars_ground"] = "engraved_ring" + } +} + +on({ operate && target.id == "dororan" && option == "Talk-to" }) { player: Player -> + when (player.quest("gunnars_ground")) { + "started" -> { + started() + } + "love_poem", "jeffery_ring" -> { + lovePoem() + } + "engrave" -> { + npc("Is it done? Have you created a work of magnificent beauty?") + engraveMenu() + } + "engraved_ring" -> { + engravedRing() + } + "show_gudrun" -> { + showGudrun() + } + "meet_chieftain", "tell_gudrun" -> { + meetChieftain() + } + "tell_dororan" -> { + aboutRing() + } + "write_poem" -> { + writePoem() + } + "more_poem" -> { + morePoem() + } + "one_more_poem" -> { + oneMore() + } + "poem_done" -> { + poem_done() + } + "poem", "recital" -> { + poem() + } + "completed" -> { + } + else -> unstarted() + } +} + +suspend fun CharacterContext.poem() { + if (!player.ownsItem("gunnars_ground")) { + player("Er, I lost the poem.") + npc("Luckily for you, I wrote a second draft.") + if (player.inventory.isFull()) { + statement("You don't have room for the poem. Speak to Dororan again when you have room.") + return + } + player.inventory.add("gunnars_ground") + player.setAnimation("14738") + item("gunnars_ground", 600,"Dororan gives you another poem." ) + npc("Try not to lose this one.") + return + } + npc("My poem is terrible, isn't it? The Chieftain will probably have me killed.") + choice { + option("Everything will work out.") { + } + option("I expect so.") { + } + } +} + +suspend fun CharacterContext.poem_done() { + npc("At last! It's done! It's finished! My finest work! Thank you so much for your help!") + player("Are you ready to present it to Chieftain?!") + npc("What? No! I'm a writer, not a performer.") + npc("I think the Chieftain would respond best to one of his people. Perhaps you could ask Gudrun to recite it to hew father?") + if (player.inventory.isFull()) { + statement("You don't have room for the poem. Speak to Dororan again when you have room.") + return + } + player["gunnars_ground"] = "poem" + player.inventory.add("gunnars_ground") + player.setAnimation("14738") + item("gunnars_ground", 400,"Dororan hands you the poem.") + choice { + option("I'll get right on it.") { + } + option("This had better be the last time.") { + } + } +} + +suspend fun CharacterContext.sweptToWar() { + npc("'Who then, in face of madness, swept to war.'") + npc("That's it! That's brilliant!") + player["gunnars_ground"] = "poem_done" + poem_done() +} + +suspend fun CharacterContext.oneMore() { + npc("It's coming together. We're nearly done! One more to go!") + npc("This one is tricky, though. It's a phrase I need. Someone did something.") + phraseMenu() +} + +suspend fun CharacterContext.phraseMenu() { + choice { + option("Threw the ball.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("Ate a tasty pie.") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("Schemed intently.") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("Went for a walk.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + } +} + +suspend fun CharacterContext.threeSyllablesMenu() { + choice { + option("Picked a rose.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("Made a raft.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("Learned to soar.") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("Cleaned the floor.") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("More words") { + threeSyllablesMenu2() + } + } +} + +suspend fun CharacterContext.threeSyllablesMenu2() { + choice { + option("Heard a song.") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("Picked a flight.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("Swept to war.") { + sweptToWar() + } + option("Tamed a shrew.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("More words") { + threeSyllablesMenu() + } + } +} + +suspend fun CharacterContext.fightMenu() { + choice { + option("Picked a fight.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("Started a war.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("Marched to battle.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("Settled the score.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("More words") { + fightMenu2() + } + } +} + +suspend fun CharacterContext.fightMenu2() { + choice { + option("Swept to war.") { + sweptToWar() + } + option("Loosed a mighty roar.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("Initiated a battle.") { + npc("That doesn't really fit. It needs tp rhyme with the word 'lore'.") + loreMenu() + } + option("Commenced fisticuffs.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("More words") { + fightMenu() + } + } +} + +suspend fun CharacterContext.loreMenu() { + choice { + option("Started a war.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("Cleaned the floor.") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("Loosed a mighty roar.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("Shut the door.") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("More words") { + loreMenu2() + } + } +} + +suspend fun CharacterContext.loreMenu2() { + choice { + option("Learned to soar") { + npc("that doesn't really fit. It needs to imply some aggressive action, like 'started a fight'.") + fightMenu() + } + option("Settled the score.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("Swept to war.") { + sweptToWar() + } + option("Counted to flour.") { + npc("that doesn't really fit. It needs to be three syllables long.") + threeSyllablesMenu() + } + option("More words") { + loreMenu() + } + } +} + +suspend fun CharacterContext.threat() { + npc("'But long is gone the author of that threat.'") + npc("Perfect! Yes!") + player["gunnars_ground"] = "one_more_poem" + oneMore() +} + +suspend fun CharacterContext.morePoem() { + npc("The poem still isn't finished, though. I have another missing word. Give me another one; anything, to get me started.") + choice { + option("Stockade.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllablePoemMenu() + } + option("Longsword.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("Dungeoneering.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("Grass.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + } +} + +suspend fun CharacterContext.syllablePoemMenu(){ + choice { + option("Storm.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("Wet.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("Hat.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("Length.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("More words.") { + syllablePoemMenu2() + } + } +} + +suspend fun CharacterContext.syllablePoemMenu2(){ + choice { + option("Debt.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("Threat.") { + threat() + } + option("Axe.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("Risk.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("More words.") { + syllablePoemMenu() + } + } +} + +suspend fun CharacterContext.rhymePoemMenu(){ + choice { + option("Debt.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("Sweat.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("Upset.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllablePoemMenu() + } + option("Brunette.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllablePoemMenu() + } + option("More words.") { + rhymePoemMenu2() + } + } +} + +suspend fun CharacterContext.rhymePoemMenu2(){ + choice { + option("Threat.") { + threat() + } + option("Regret.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllablePoemMenu() + } + option("Set.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("Wet.") { + npc("That doesn't really fit. It needs to mean something like 'danger'.") + dangerPoemMenu() + } + option("More words.") { + rhymePoemMenu() + } + } +} + +suspend fun CharacterContext.dangerPoemMenu(){ + choice { + option("Risk.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("Crisis.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllablePoemMenu() + } + option("Peril.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllablePoemMenu() + } + option("Menace.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("More words.") { + dangerPoemMenu2() + } + } +} + +suspend fun CharacterContext.dangerPoemMenu2(){ + choice { + option("Upset.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllablePoemMenu() + } + option("Storm.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("Hazard.") { + npc("That doesn't really fit. It needs to rhyme with the word 'yet'.") + rhymePoemMenu() + } + option("Threat.") { + threat() + } + option("More words.") { + dangerPoemMenu() + } + } +} + + +suspend fun CharacterContext.aboutRing(){ + npc("Did you give Gudrun the ring? What did she think? Did it capture her heart?") + player("There's a problem.") + npc("It's because I'm a dwarf, isn't it? Or because I'm a poet? I knew it! I'm completely worthless!") + choice { + option("No, she liked the ring.") { + npc("Oh! Then what's the problem?") + MostCruel() + } + option("Would you be quiet for a moment?") { + npc("Sorry!") + MostCruel() + } + } +} + +suspend fun CharacterContext.MostCruel(){ + npc("Most cruel is fate! Most cruel! Why not?") + player("He's obsessed with the stories of his ancestors. He says his people are still at war.") + npc("This village has stood for a hundred years!") + player("I heard him arguing with one of the others. He says he honours his ancestors this way.") + npc("Really? Interesting.") + choice { + option("Do you know a lot about the village's history?") { + npc("Not really. I talked with Hunding, who guards this tower here.") + anyIdea() + } + option("What are we going to do?") { + anyIdea() + } + } +} + +suspend fun CharacterContext.anyIdea(){ + npc("An idea occurs to me, but it is hubris of the greatest magnitude.") + player("What is it?") + npc("What if I wrote a poem? Forged a sweeping, historical epic? Crafted a tale to touch the chieftain's soul?") + player("Will that work?") + npc("To win the heart of my beloved from her father's iron grasp? It is worth it just to try!") + player.open("fade_out") + delay(5) + player.open("fade_in") + delay(1) + player["gunnars_ground"] = "write_poem" + writePoem() +} + +suspend fun CharacterContext.writePoem(){ + npc("'Even the bloodiest rose must settle.' Mixed metaphor. Whats settles? Detritus. That's hardly flattering.") + npc("'Even the rolliest boulder...'") + player("How is the poem going?") + npc("I'm stuck! I'm a worthless wordsmith! My work is pointless! My life is pointless!") + choice { + option("I'm sure that's not true.") { + stuckOnWord() + } + option("What's the problem?") { + stuckOnWord() + } + } +} + +suspend fun CharacterContext.stuckOnWord(){ + npc("I'm stuck on a word. By the colossus of King Alvis! I can't find the words!") + player("Maybe I can help. What sort of word?") + npc("I don't know! I'm not some kind of word scientist. I just feel it out as I go.") + npc("Maybe you could suggest some words to get me started. Then I can tell you more.") + player("Alright, How about, uh...") + poemMenu() +} + +suspend fun CharacterContext.poemMenu(){ + choice { + option("Cucumber.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllableMenu() + } + option("Monkey.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("Saradomin.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Barbarian.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllableMenu() + } + } +} + +suspend fun CharacterContext.syllableMenu(){ + choice { + option("Ham.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Fey.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("Jaunt.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Grass.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("More words") { + syllableMenu2() + } + } +} + +suspend fun CharacterContext.syllableMenu2(){ + choice { + option("Roam.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Fish.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Stray.") { + stray() + } + option("Hay.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("More words") { + syllableMenu() + } + } +} + +suspend fun CharacterContext.wordsMenu(){ + choice { + option("Deviate.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllableMenu() + } + option("Roam.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Veer.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Traipse.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("More words") { + wordsMenu2() + } + } +} + +suspend fun CharacterContext.wordsMenu2(){ + choice { + option("Meander.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllableMenu() + } + option("Astray.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllableMenu() + } + option("Jaunt.") { + npc("That doesn't really fit. It needs to rhyme with the word 'day'.") + rhymeMenu() + } + option("Stray.") { + stray() + } + option("More words") { + wordsMenu() + } + } +} + +suspend fun CharacterContext.rhymeMenu(){ + choice { + option("Lay.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("Beret.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllableMenu() + } + option("May.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("Hay.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("More words") { + rhymeMenu2() + } + } +} +suspend fun CharacterContext.rhymeMenu2(){ + choice { + option("Stray.") { + stray() + } + option("Dismay.") { + npc("That doesn't really fit. It needs to be one syllable long.") + syllableMenu() + } + option("Tray.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("Fey.") { + npc("That doesn't really fit. It needs to mean something like 'wandering aimlessly'.") + wordsMenu() + } + option("More words") { + rhymeMenu() + } + } +} + +suspend fun CharacterContext.stray() { + npc("'And from his righteous purpose never stray.'") + npc("That fits! It fits perfectly. Right meaning, right length, right rhyme. Well done!") + player["gunnars_ground"] = "more_poem" + morePoem() +} + +suspend fun CharacterContext.meetChieftain(){ + npc("Did you give Gudrun the ring? What did she think?") + player("She liked it, but there's a problem. I'm dealing with it.") + npc("Oh no!") +} + +suspend fun CharacterContext.showGudrun(){ + if (!player.ownsItem("dororans_engraved_ring")) { + npc("I know. I found it on the ground.") + if (player.inventory.isFull()) { + statement("You don't have room for the ring. Speak to Dororan again when you have room.") + return + } + player.inventory.add("dororans_engraved_ring") + player.setAnimation("14738") + item("dororans_engraved_ring", 400,"Dororan hands you back the engraved ring.") + npc("Please try not to lose it again. It's very precious.") + return + } + npc("Please take the ring to Gudrun for me.") + choice { + option("Where is she?") { + npc("Inside the barbarian village.") + } + option("I'm on it.") { + } + } +} + +suspend fun CharacterContext.engravedRing() { + npc("Is it done? Have you created a work of magnificent beauty?") + if (!player.ownsItem("dororans_engraved_ring")) { + player("I did engrave it. but I seem to have lost it.") + npc("Is this it? I found it on the ground. You've done a great job on it.") + if (player.inventory.isFull()) { + statement("You don't have room for the ring. Speak to Dororan again when you have room.") + return + } + player.inventory.add("dororans_engraved_ring") + player.setAnimation("14738") + item("dororans_engraved_ring", 400,"Dororan hands you back the engraved ring.") + npc("Please try not to lose it again! Now, will you do one more thing for me?") + oneMoreThing() + return + } + choice { + option("It's come out perfectly.") { + item("dororans_engraved_ring", 400,"You show Dororan the engraved ring.") + npc("You're right! It's perfect!") + npc("Will you do one more thing for me?") + oneMoreThing() + } + option("How does this look?") { + item("dororans_engraved_ring", 400,"You show Dororan the engraved ring.") + npc("Brilliant! That's perfect") + npc("Will you do one more thing for me?") + oneMoreThing() + } + option("It's a complete disaster.") { + item("dororans_engraved_ring", 400,"You show Dororan the engraved ring.") + npc("I don't know what you mean: it's perfect!") + npc("Will you do one more thing for me?") + oneMoreThing() + } + } +} + +suspend fun CharacterContext.oneMoreThing() { + choice { + option("Of course.") { + veryWell() + } + option("What now?") { + veryWell() + } + } +} + +suspend fun CharacterContext.veryWell() { + npc("I fear she will only judge this poor book by its cover. Would you take the ring to Gudrun for me?") + choice { + option("Very well.") { + whereIsShe() + } + option("I hope this is going somewhere.") { + whereIsShe() + } + } +} + +suspend fun CharacterContext.whereIsShe() { + npc("Please don't tell her I'm a dwarf just yet.") + player["gunnars_ground"] = "show_gudrun" + choice { + option("Where is she?") { + npc("Inside the barbarian village.") + } + option("I'm on it.") { + } + } +} + +suspend fun CharacterContext.unstarted() { + npc("'My heart with burdens heavy does it lie.'") + npc("'For never did I...'") + npc("Um...") + choice { + option("'...ever learn to fly?'") { + poet() + } + option("'...eat redberry pie?'") { + poet() + } + option("'...get the evil eye?'") { + poet() + } + } +} + +suspend fun CharacterContext.started() { + npc("I need a ring of purest gold. Then we can engrave it with the words of my heart.") + player.refreshQuestJournal() + npc("Oh! I know the perfect place to get a gold ring.") + npc("Edgeville's metalsmith, jeffery, labours like myself under the weight of unrequited love.") + npc("Perhaps, if you took one of my love poems to jeffery, he would trade it for a gold ring.") + if (player.inventory.isFull()) { + statement("You don't have room for the poem. Speak to Dororan again when you have room.") + return + } + player["gunnars_ground"] = "love_poem" + player.inventory.add("love_poem") + player.setAnimation("14738") + item("love_poem", 600,"Dororan gives you a poem.") + choice { + option("I have some questions.") { + npc("By all means.") + lovePoemMenu() + } + option("I'll return with a ring from Jeffery.") { + } + } +} + +suspend fun CharacterContext.somethingElse() { + choice { + option("I want to ask about something else.") { + npc("By all means.") + lovePoemMenu() + } + option("I'll return with a ring from Jeffery.") { + } + } +} + +suspend fun CharacterContext.lovePoemMenu() { + choice { + option("Does it have to be a ring from Jeffery?") { + npc("Yes! Jeffery's rings are timeless works of incomparable romantic splendour.") + somethingElse() + } + option("Where is Edgeville?") { + npc("North of here, beyond a ruined fortress. It used to be a bustling den of cutthroats but it's quite quiet these days.") + somethingElse() + } + option("Why can't you go yourself?") { + npc("Some time ago, Jeffery asked me for advice in acting on his affections. I gave him the best advice that I could.") + npc("Things didn't work out very well for him. One thing let to another and now he no longer wishes to speak to me.") + somethingElse() + } + option("Why can't you give a poem directly to Gudrun?") { + npc("These love poems are written in the Misthalinian style. A noble barbarian maiden would be insulted, not flattered.") + somethingElse() + } + option("You want me to trick her into thinking you made the ring?") { + npc("Oh no, nothing like that! I have the words, I just need your help with the tools.") + somethingElse() + } + } +} + +suspend fun CharacterContext.lovePoem() { + npc("'I await in eagerness for a loop of lustrous grandeur.' No, that just sounds ridiculous. Have you brought me a ring from Jeffery?'") + if (!player.ownsItem("ring_from_jeffery") && player.quest("gunnars_ground") == "jeffery_ring") { + player("I did get a ring from jeffery, but I seem to have lost it.") + npc("How careless!") + npc("Is it this one? I found it on the ground.") + if (player.inventory.isFull()) { + statement("You don't have room for the ring. Speak to Dororan again when you have room.") + return + } + player.inventory.add("ring_from_jeffery") + player.setAnimation("14738") + // player.playSound("")//todo + item("ring_from_jeffery", 600,"Dororan gives you back the ring.") + engrave() + return + } + if (player.holdsItem("ring_from_jeffery")) { + player("I have one right here.") + item("ring_from_jeffery", 600, "You show Dororan the ring from Jeffery.") + npc("Thank you! That's exactly what I need!") + engrave() + return + } + choice { + if (!player.ownsItem("love_poem") && player.quest("gunnars_ground") == "love_poem") { + option("I lost the poem I was supposed to take to Jeffer.") { + npc("I'll give you another one.") + if (player.inventory.isFull()) { + statement("You don't have room for the poem. Speak to Dororan again when you have room.") + return@option + } + player.inventory.add("love_poem") + player.setAnimation("14738") + item("love_poem", 600,"Dororan gives you another poem.") + npc("Try to be more careful with this one.") + return@option + } + } + option("Where would I find one?") { + npc("Go north to Jeffery in Edgeville and trade the poem I gave you for a gold ring.") + choice { + option("I have some questions.") { + npc("By all means.") + lovePoemMenu() + } + option("I'll return with a ring from Jeffery.") { + } + } + } + option("I'll return with a ring from Jeffery.") { + } + } +} + +suspend fun CharacterContext.engrave() { + npc("Now, would you engrave something on it for me?") + choice { + option("What do you want me to engrave?") { + engraveSomething() + } + option("It had better be something impressive.") { + engraveSomething() + } + } +} + +suspend fun CharacterContext.engraveSomething() { + npc("I've given this some thought.") + npc("'Gudrun the Fair, Gudrun the Fiery.'") + choice { + option("How do I engrave that?") { + npc("Just use a chisel on the gold ring.") + player["gunnars_ground"] = "engrave" + engraveMenu() + } + option("That sounds simple enough.") { + npc("Just use a chisel on the gold ring.") + player["gunnars_ground"] = "engrave" + engraveMenu() + } + } +} + +suspend fun CharacterContext.engraveMenu() { + choice { + option("Do you have a chisel I can use?") { + haveChisel() + } + option("Isn't a chisel a bit clumsy for that?") { + chiselBitClumsy() + } + option("Not yet.") { + } + } +} + +suspend fun CharacterContext.haveChisel() { + npc("Yes, here you go.") + if (player.inventory.isFull()) { + statement("You don't have room for the chisel. Speak to Dororan again when you have room.") + } else { + player.inventory.add("chisel") + player.setAnimation("14738") + item("chisel", 600,"Dororan gives you a chisel.") + } + choice { + option("Isn't a chisel a bit clumsy for that?") { + chiselBitClumsy() + } + option("Okay.") { + } + } +} + +suspend fun CharacterContext.chiselBitClumsy() { + npc("I've seen jewelcrafters use them for all sorts of precise work.") + choice { + option("Do you have a chisel I can use?") { + haveChisel() + } + option("Okay.") { + } + } +} + +suspend fun CharacterContext.poet() { + npc("You're a poet too?") + choice { + option("Yes.") { + npc("Ah! Then I'm sure you can identify with the arduous state of my life.") + identify() + } + option("Maybe a bit.") { + npc("Oh. Then maybe you can identify with the arduous state of my life.") + identify() + } + option("No.") { + npc("oh. How can I expect you to identify with the arduous state of my life?") + identify() + } + } +} + +suspend fun CharacterContext.identify() { + npc("My heart is stricken with that most audacious of maladies!") + choice { + option("Angina?") { + love() + } + option("Hypertension?") { + love() + } + option("Coclearabsidosis?") { + love() + } + } +} + +suspend fun CharacterContext.love() { + npc("Love!") + npc("The walls of my heart are besieged by love's armies, and those walls begin to tumble!") + npc("In the barbarian village lives the fairest maiden I have witnessed in all my life.") + choice { + option("What's so special about her?") { + npc("I wouldn't know where to start! Her fiery spirit? Her proud bearing? Her winsome form?") + choice { + option("But why is this making you sad?") { + getToThePoint() + } + option("What do you actually need?") { + getToThePoint() + } + } + } + option("Get to the point.") { + getToThePoint() + } + } +} + +suspend fun CharacterContext.getToThePoint() { + npc("The people of this village value strength, stature and riches. I have none of these things.") + npc("My people are indomitable warriors, dripping with gold and precious gems, but not I.") + npc("I am not built fpr combat, and poetry has proven a life of poverty!") + choice { + option("There must be something you can do.") { + helpMe() + } + option("Not to mention low stature.") { + npc("You see!") + helpMe() + } + } +} + +suspend fun CharacterContext.helpMe() { + npc("If Gudrun could ever love a dwarf, surely she would need to see my artisanry.") + npc("Will you help me? I am no crafter of metal.") + if (player.levels.get(Skill.Crafting) < 5) { + statement("You need a Crafting level of at least 5 to start this quest.") + } else { + choice("Start Gunnar's Ground quest?") { + option("Yes.") { + player["gunnars_ground"] = "started" + started() + } + option("No.") { + } + } + } +} + +on({ operate && target.id == "dororan_after_quest" && option == "Talk-to" }) { player: Player -> + when (player.quest("gunnars_ground")) { + "completed" -> { + if (player["dororan_ruby_bracelet", 0] != 1) { + npc("Come in, my friend, come in! There is another matter I could use your assistance with.") + } else if (player["dororan_dragonstone_necklace", 0] != 1) { + npc("I have another piece of jewellery to engrave.") + } else if (player["dororan_onyx_amulet", 0] != 1) { + npc("I have one last piece of jewellery to engrave.") + } else { + npc("Thanks so much for everything you've done for us!") + npc("What can I do for you?") + } + if (player["dororan_ruby_bracelet", 0] != 1 || player["dororan_dragonstone_necklace", 0] != 1 || player["dororan_onyx_amulet", 0] != 1) { + choice { + if (player["dororan_ruby_bracelet", 0] != 1) { + option("What is it?") { + npc("I have some more jewellery for Gudrun and I need your help to engrave them.") + choice { + option("What's the first piece?") { + npc("A magnificent ruby bracelet.") + npc("'With beauty blessed.'") + choice { + option("Engrave the bracelet.") { + if (player.levels.get(Skill.Crafting) < 72) { + item("ruby_bracelet", 400, "you need a Crafting level of at least 42 to engrave the ruby bracelet.") + npc("That's a shame. Maybe you can try again another time.") + return@option + } + player.setAnimation("engrave") + player.experience.add(Skill.Crafting, 2000.0) + player["dororan_ruby_bracelet"] = 1 + // items( "chisel","ruby_bracelet","You carefully engrave 'With beauty blessed' onto the ruby bracelet.") + npc("Magnificent! Outstanding! I will give this to her immediately. Please, come back when you have time") + } + option("Don't engrave the bracelet.") { + npc("That's a shame. Maybe you can try again another time.") + } + } + } + option("I want to talk about something else.") { + npc("What can I do for you?") + someThingElse() + } + option("I don't have time right now.") { + } + } + } + } else if (player["dororan_dragonstone_necklace", 0] != 1) { + option("What's this one?") { + npc("A fine dragonstone necklace.") + npc("There's not much room...how about just 'Gudrun'?") + choice { + option("Engrave the necklace.") { + if (player.levels.get(Skill.Crafting) < 42) { + item("dragonstone_necklace", 400, "you need a Crafting level of at least 72 to engrave the dragonstone necklace.") + npc("That's a shame. Maybe you can try again another time.") + return@option + } + player.setAnimation("engrave") + player.experience.add(Skill.Crafting, 10000.0) + player["dororan_dragonstone_necklace"] = 1 + // items( "chisel","dragonstone_necklace","You skillfully engrave 'Gudrun' onto the dragonstone necklace.") + npc("Another astonishing piece of work! Please, come back later to see if I have other crafting tasks.") + } + option("Don't engrave the necklace.") { + npc("That's a shame. Maybe you can try again another time.") + } + } + } + } else if (player["dororan_onyx_amulet", 0] != 1) { + option("What is it?") { + npc("An onyx amulet!") + npc("'The most beautiful girl in the room.'") + choice { + option("Engrave the amulet.") { + if (player.levels.get(Skill.Crafting) < 90) { + item("onyx_amulet", 400, "you need a Crafting level of at least 90 to engrave the onyx amulet.") + npc("That's a shame. Maybe you can try again another time.") + return@option + } + player.setAnimation("engrave") + player.experience.add(Skill.Crafting, 20000.0) + player["dororan_onyx_amulet"] = 1 + // items( "chisel","onyx_amulet","You expertly engrave 'The most beautiful girl in the room' onto the onyx amulet.") + npc("That's fantastic! Excellent work.") + } + option("Don't engrave the amulet.") { + npc("That's a shame. Maybe you can try again another time.") + } + } + } + } + option("I want to talk about something else.") { + npc("What can I do for you?") + someThingElse() + } + option("I don't have time right now.") { + } + } + } else { + someThingElse() + } + } + else -> player.message("error") + } +} + +suspend fun CharacterContext.someThingElse() { + choice { + option("How are things?") { + npc("Every morning I wake to sunshine and birdsong! Life is marvellous!") + choice { + option("I want to talk about something else.") { + npc("What can I do for you?") + someThingElse() + } + option("Goodbye.") { + npc("Goodbye!") + } + } + } + option("This is a very large house.") { + npc("I know! I don't know where Gunthor would have got such a thing. Maybe Gudrun has some idea.") + choice { + option("I want to talk about something else.") { + npc("What can I do for you?") + someThingElse() + } + option("Goodbye.") { + npc("Goodbye!") + } + } + } + option("I'd like to see the poem you wrote for Gunthor.") { + if (player.inventory.isFull()) { + statement("you don't have room for the poem.") + return@option + } + player.inventory.add("gunnars_ground") + player.setAnimation("14738") + item("gunnars_ground", 600,"Dororan gives you a copy of the poem.") + npc("There you go!") + } + if (!player.ownsItem("swanky_boots")) { + option("I seem to have mislaid my swanky boots.") { + npc("Not to worry! There are some left. Here you go.") + if (player.inventory.isFull()) { + statement("you don't have room for the boots.") + return@option + } + player.setAnimation("14738") + player.inventory.add("swanky_boots") + item("swanky_boots", 600,"Dororan gives you some more boots.") + npc("Be more careful with these ones! I don't have an infinite supply.") + } + } + option("Goodbye.") { + npc("Goodbye!") + } + } +} \ No newline at end of file diff --git a/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Gudrun.kts b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Gudrun.kts new file mode 100644 index 000000000..0ce05471d --- /dev/null +++ b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Gudrun.kts @@ -0,0 +1,584 @@ +package world.gregs.voidps.world.map.barbarian_village + +import world.gregs.voidps.engine.client.clearCamera +import world.gregs.voidps.engine.client.message +import world.gregs.voidps.engine.client.moveCamera +import world.gregs.voidps.engine.client.turnCamera +import world.gregs.voidps.engine.client.ui.open +import world.gregs.voidps.engine.entity.character.CharacterContext +import world.gregs.voidps.engine.entity.character.face +import world.gregs.voidps.engine.entity.character.move.tele +import world.gregs.voidps.engine.entity.character.npc.NPCOption +import world.gregs.voidps.engine.entity.character.npc.NPCs +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.entity.character.player.skill.Skill +import world.gregs.voidps.engine.entity.character.setAnimation +import world.gregs.voidps.engine.entity.item.Item +import world.gregs.voidps.engine.event.on +import world.gregs.voidps.engine.inject +import world.gregs.voidps.engine.inv.add +import world.gregs.voidps.engine.inv.holdsItem +import world.gregs.voidps.engine.inv.inventory +import world.gregs.voidps.engine.inv.remove +import world.gregs.voidps.engine.queue.LogoutBehaviour +import world.gregs.voidps.engine.queue.queue +import world.gregs.voidps.engine.queue.softQueue +import world.gregs.voidps.engine.suspend.delay +import world.gregs.voidps.type.Direction +import world.gregs.voidps.type.Region +import world.gregs.voidps.type.Tile +import world.gregs.voidps.world.activity.quest.* +import world.gregs.voidps.world.interact.dialogue.* +import world.gregs.voidps.world.interact.dialogue.type.* +import world.gregs.voidps.world.interact.entity.sound.playJingle + +on({ operate && target.id == "gudrun" || target.id == "gudrun_after_cutscene" && option == "Talk-to" }) { player: Player -> + when (player.quest("gunnars_ground")) { + "gunnars_ground" -> { + gunnarsGround() + } + "recital" -> { + recital() + } + "poem" -> { + poem() + } + "tell_dororan", "write_poem", "more_poem", "one_more_poem", "poem_done" -> { + npc("If there's anything you can do to make papa see sense, please do it.") + } + "tell_gudrun" -> { + whatHeSay() + } + "meet_chieftain" -> { + npc("If there's anything you can do to make papa see sense, please do it.") + meetChieftain() + } + "show_gudrun" -> { + showGudrun() + } + else -> unstarted() + } +} + +suspend fun CharacterContext.recital() { + npc("Are you ready for the recital?") + choice { + option("Yes.") { + cutscene() + } + option("Not right now.") { + } + } +} + +val npcs: NPCs by inject() +val region = Region(12341) + +suspend fun CharacterContext.cutscene() { + player.open("fade_out") + val instance = startCutscene(region) + val offset = instance.offset(region) + setCutsceneEnd(instance) + delay(4) + player.tele(Tile(3078, 3435).add(offset), clearInterfaces = false) + val dororan = npcs.add("dororan_cutscene", Tile(3079, 3435).add(offset), Direction.SOUTH) ?: return + dororan.setAnimation("14725") + player.setAnimation("14724") + dororan.face(Direction.NORTH) + player.face(Direction.NORTH) + player.moveCamera(Tile(3079, 3430).add(offset), 280) + player.turnCamera(Tile(3079, 3436).add(offset), 230) + delay(2) + player.open("fade_in") + npc("dororan_cutscene", "How long have they been in there?") + player.setAnimation("6709") + choice { + option("They're just starting.") { + cutsceneMenu() + } + option("You're late.") { + cutsceneMenu() + } + } +} + +suspend fun CharacterContext.cutsceneMenu() { + npc("dororan_cutscene", "This isn't going to work.") + choice { + option("Why's that?") { + player.setAnimation("6709") + cutsceneMenu2() + } + option("You're so pessimistic.") { + player.setAnimation("6709") + cutsceneMenu2() + } + } +} + +suspend fun CharacterContext.cutsceneMenu2() { + npc("dororan_cutscene", "What was I thinking? You should go in there and stop them before Gudrun makes a fool of herself.") + choice { + option("Okay, I will.") { + player.setAnimation("6709") + npc("dororan_cutscene", "No! Wait, stay here, it's too late now. We'll just have to see how it turns out.") + cutsceneMenu3() + } + option("Don't be silly.") { + player.setAnimation("6709") + npc("dororan_cutscene", "You're right, it's too late now. We'll just have to see how it turns out.") + cutsceneMenu3() + } + } +} + +suspend fun CharacterContext.cutsceneMenu3() { + npc("dororan_cutscene", "I can't hear what's happening. Can you hear what's happening?") + player.setAnimation("6709") + player("Gunthor is laughing at something.") + npc("dororan_cutscene", "He's probably considering the various tortures he has planned for me.") + player.setAnimation("6709") + choice { + option("Why would he do that?") { + cutsceneMenu4() + } + option("Now you're just being ridiculous.") { + cutsceneMenu4() + } + } +} + +suspend fun CharacterContext.cutsceneMenu4() { + npc("dororan_cutscene", "The poem says you can honour your ancestors by settling peacefully on the land they conquered.") + npc("dororan_cutscene", "He'll probably just find it insulting.") + player.setAnimation("6709") + choice { + option("Now's your chance to find out.") { + cutscenePart2() + } + option("You're doomed.") { + cutscenePart2() + } + } +} + +suspend fun CharacterContext.cutscenePart2() { + player.queue.clear("gunnars_ground_cutscene_end") + player.open("fade_out") + val instance = startCutscene(region) + val offset = instance.offset(region) + setCutsceneEnd(instance) + delay(4) + player.tele(Tile(3083, 3426).add(offset), clearInterfaces = false) + player.face(Direction.WEST) + val dororan = npcs.add("dororan_cutscene", Tile(3082, 3428).add(offset), Direction.SOUTH) ?: return + val gudrun = npcs.add("gudrun_cutscene", Tile(3080, 3426).add(offset), Direction.SOUTH) ?: return + val kjell = npcs.add("kjell_cutscene", Tile(3077, 3426).add(offset), Direction.SOUTH) ?: return + val gunthor = npcs.add("chieftain_gunthor_cutscene", Tile(3079, 3425).add(offset), Direction.SOUTH) ?: return + val haakon = npcs.add("haakon_the_champion_cutscene", Tile(3078, 3425).add(offset), Direction.SOUTH) ?: return + player.moveCamera(Tile(3079, 3419).add(offset), 400) + player.turnCamera(Tile(3079, 3426).add(offset), 150) + delay(2) + player.open("fade_in") + npc("dororan_cutscene", "I hope they at least give me a decent burial.") + gunthor.setAnimation("14734") + npc("chieftain_gunthor_cutscene", "Freemen! Freemen! I have an announcement!") + npc("kjell_cutscene", "Hear the chieftain speak! Hear him!") + npc("chieftain_gunthor_cutscene", "We have always borne the legacy of our ancestors, and we have borne it with honour!") + npc("kjell_cutscene", "FOR GUNNAR!") + npc("chieftain_gunthor_cutscene", "And though we honour them still, the time of our ancestors is past. this is the time of Gunthor!") + npc("haakon_the_champion_cutscene", "FOR GUNNAR!") + npc("chieftain_gunthor_cutscene", "Gunthor says: This is Gunnar's ground, bought with blood! Let it remain Gunnar's ground forever! Here we settle!") + npc("chieftain_gunthor_cutscene", "GUNNAR'S GROUND!") + kjell.setAnimation("1531") + haakon.setAnimation("14739") + npc("haakon_the_champion_cutscene", "GUNNAR'S GROUND!") + player.open("fade_out") + delay(4) + dororan.tele(Tile(3082, 3426).add(offset)) + dororan.face(Direction.WEST) + gudrun.tele(Tile(3081, 3426).add(offset)) + gudrun.face(Direction.EAST) + val npc = listOf(kjell, gunthor, haakon) + for (remove in npc) { + npcs.remove(remove) + npcs.removeIndex(remove) + npcs.releaseIndex(remove) + } + player.moveCamera(Tile(3084, 3421).add(offset), 350) + player.turnCamera(Tile(3082, 3426).add(offset), 250) + player.open("fade_in") + npc("gudrun_cutscene", "That was brilliant! I must know who wrote that poem.") + npc("dororan_cutscene", "Um, that would be me. Hello") + npc("gudrun_cutscene", "That line about beauty was for me, wasn't it?") + npc("dororan_cutscene", "Uh, Yes.") + npc("gudrun_cutscene", "You're the mystery poet who sent me the gold ring!") + npc("dororan_cutscene", "Sorry.") + npc("gudrun_cutscene", "I had no idea dwarves could be so romantic! Come here! ") + delay(2) + //anim 17513 - Gudrun Hugging Dororan (Gunnar’s Ground) ? + gudrun.setAnimation("17513") + player.queue.clear("gunnars_ground_cutscene_end") + endCutscene(instance) + player["gunnars_ground"] = "gunnars_ground" + player["kjell"] = "guitar" + player["dororan"] = "hidden" + player["dororan_after_cutscene"] = "shown" + player["gudrun"] = "hidden" + player["gudrun_after_cutscene"] = "shown" + gunnarsGround() +} + +suspend fun CharacterContext.gunnarsGround() { + npc("Papa was so impressed by Dororan's poem, he's made him the village poet!") + npc("dororan_after_cutscene2","I'm more then a little surprised! He even gave me a house to live in!") + npc("Our people's tradition is that the tribe provides lodging for the poet.") + npc("dororan_after_cutscene2","It's huge!") + npc("It's not in the village. It's east of here: across the river and north of the road on the way to Varrock. It's a big house with roses outside.") + npc("dororan_after_cutscene2","I think Gunthor wants to keep me close, but not too close. Oh, I found something there for you!") + npc("dororan_after_cutscene2","Whoever lived there before left a dozen pairs of boots in the attic.") + npc("dororan_after_cutscene2","I picked out a pair for you to thank you for all your help.") + npc("dororan_after_cutscene2","Underneath them all was this magic lamb. You should have it as well!") + npc("We're going to the new house. You should come and visit!") + npc("dororan_after_cutscene2","Yes, we'll see you there!") + choice { + option("I'll see you soon.") { + finishQuest() + } + option("I'll consider dropping in.") { + finishQuest() + } + } +} + +suspend fun CharacterContext.finishQuest() { + npc("dororan_after_cutscene2","Goodbye!") + npc("Goodbye!") + player.open("fade_out") + delay(4) + player["dororan_after_cutscene"] = "hidden" + player["gudrun_after_cutscene"] = "hidden" + player["dororan_after_quest"] = "shown" + player["gudrun_after_quest"] = "shown" + player.open("fade_in") + questComplete() +} + + +fun CharacterContext.setCutsceneEnd(instance: Region) { + player.queue("gunnars_ground_cutscene_end", 1, LogoutBehaviour.Accelerate) { + endCutscene(instance) + } +} + +suspend fun CharacterContext.endCutscene(instance: Region) { + player.open("fade_out") + delay(3) + player.tele(3081, 3416) + stopCutscene(instance) + player.clearCamera() +} + +suspend fun CharacterContext.poem() { + if (player.holdsItem("gunnars_ground")) { + npc("What have you got there?") + player("Another gift from your mysterious suitor.") + npc("A scroll?") + player("It's a poem; a story to convince your father to settle down. You could recite it to him.") + npc("Let me see that.") + player.setAnimation("14737") + item("gunnars_ground", 400,"You show Gudrun the poem") + npc("'Gunnar's Ground'") + npc("Yes! I think this could work. I'll go to the longhouse right away!") + player.inventory.remove("gunnars_ground") + player["gunnars_ground"] = "recital" + cutscene() + } else { + npc("What is it?") + player("I was meant to bring you a poem, but I seem to have mislaid it.") + } +} + +suspend fun CharacterContext.whatHeSay() { + npc("What did he say?") + player("He mentioned someone called Gunnar, and that you should think about his feelings.") + npc("By the eyeballs of Guthix! Always Gunnar!") + choice { + option("Who is Gunnar?") { + npc("He was my great-grandpapa! He founded this village a hundred years ago.") + fathersAttitude() + } + option("What should we do now?") { + npc("I don't know. Maybe your mystery man has some ideas.") + player["gunnars_ground"] = "tell_dororan" + player("I'll ask him.") + } + } +} + +suspend fun CharacterContext.fathersAttitude() { + choice { + option("You don't seem to share your father's attitude towards him.") { + npc("I think there's a difference between respecting my ancestors and obsessing over them. Papa thinks whatever stupid war Gunnar fought is still going on.") + npc("I don't know. Maybe your mystery man has some ideas.") + player["gunnars_ground"] = "tell_dororan" + player("I'll ask him.") + } + option("What should we do now?") { + npc("I don't know. Maybe your mystery man has some ideas.") + player["gunnars_ground"] = "tell_dororan" + player("I'll ask him.") + } + } +} + +suspend fun CharacterContext.meetChieftain() { + choice { + option("Where is he?") { + npc("In the longhouse at the north end of the village, drinking and shouting.") + } + option("I'll see what I can do.") { + } + } +} + +suspend fun CharacterContext.showGudrun() { + npc("kjell_sword","Gudrun! You caught enough fish?") + npc("Yes! I have plenty of fish!") + npc("kjell_sword","Your father needs many fish to feed the freemen!") + npc("I know!") + npc("kjell_sword","Maybe you sneak off to the outerlander city again? Buy fish in market, instead of catching them?") + npc("Shut up! I'm much better at fishing than you.") + npc("kjell_sword","You are not!") + npc("Just guard the hut like chieftain told you to!") + npc("kjell_sword","Fine!") + npc("Stupid barbarian.") + npc("Sorry about that, stranger. Did you want something?.") + player("Are you Gudrun?") + npc("Yes.") + if (player.holdsItem("dororans_engraved_ring")) { + player("This is for you.") + player.setAnimation("14737") + item("dororans_engraved_ring", 400,"You show Gudrun the ring.") + npc("It's lovely! There's something written on it:") + npc("'Gudrun the Fair, Gudrun the Fiery.' Is it about me?") + choice { + option("Yes.") { + aboutRing() + } + option("Presumable.") { + aboutRing() + } + } + } else { + player("I was meant to bring you a ring but I seem to have mislaid it.") + } +} + +suspend fun CharacterContext.aboutRing() { + npc("This is beautiful gift, stranger. Thank you.") + choice { + option("The ring isn't from me!") { + whoFrom() + } + option("It should belong to someone just as beautiful.") { + npc("That's very flattering! You look like an adventurer, though?") + thatsRight() + } + } +} + +suspend fun CharacterContext.thatsRight() { + choice { + option("That's right.") { + npc("I'm sorry, I could never get involved with an adventurer.") + whoFrom() + } + option("Some call me that.") { + npc("I'm sorry, I could never get involved with an adventurer.") + whoFrom() + } + } +} + +suspend fun CharacterContext.whoFrom() { + npc("Oh! Who is it from?") + choice { + option("A great poet.") { + npc("A tale-teller? A bard? My people have great respect from poets.") + outsideVillage() + } + option("A secret admirer.") { + npc("Does that really happen? How exciting!") + outsideVillage() + } + option("A short suitor.") { + npc("What?") + player("A petite paramour.") + npc("What?") + player("A concise courter!") + outsideVillage() + } + } +} + +suspend fun CharacterContext.outsideVillage() { + npc("This man, he is from outside the village?") + player("Yes.") + npc("I would love to leave the village and be romanced by exotic, handsome, outerlander men. There's a problem, though.") + player("What's that?") + npc("My papa, the chieftain. He would never let an outerlander pursue me.") + player("Why not?") + npc("He thinks all your people are our enemies.") + choice { + option("So, you want me to talk to your father?") { + npc("I suppose that might work.") + reasonWithHim() + } + option("So, you want me to kill your father?") { + npc("What? no! Maybe...you could just try talking to him.") + reasonWithHim() + } + } +} + +suspend fun CharacterContext.reasonWithHim() { + npc("I've tried to reason with him, but he's impossible! Maybe he'll listen to you. I know some of the others feel the same, but they're loyal to papa.") + player["gunnars_ground"] = "meet_chieftain" + player.inventory.remove("dororans_engraved_ring") + meetChieftain() +} + +suspend fun CharacterContext.unstarted() { + npc("Can I help you, stranger?") + npc("kjell_sword","Why are you talking to that outerlander?") + npc("It's none of your business, Kjell! Just guard the hut!") + npc("Sorry about that. Did you want something?") + choice { + option("What is this place?") { + whatIsThisPlace() + } + option("Who are you?") { + whoAreYou() + } + option("Actually, no. Goodbye") { + } + } +} + +suspend fun CharacterContext.whoAreYou() { +npc("My name is Gudrun. My father, Gunthor, is chieftain of the village.") + choice { + option("What is this place?") { + whatIsThisPlace() + } + option("Goodbye.") { + } + } +} + +suspend fun CharacterContext.whatIsThisPlace() { + npc("Outerlanders call this the barbarian village. It doesn't have a name because...it's complicated.") + npc("if you want to know more, you should talk to Hunding. He's up in the tower at the east entrance.") + choice { + option("Who are you?") { + whoAreYou() + } + option("Goodbye.") { + } + } +} + +fun CharacterContext.questComplete() { + player.playJingle("quest_complete_3") + player["gunnars_ground"] = "completed" + player.inc("quest_points", 5) + player.experience.add(Skill.Crafting, 300.0) + player.softQueue("quest_complete", 1) { + player.sendQuestComplete("Gunnar's Ground", listOf( + "5 Quest Points", + "300 Crafting XP.", + "Antique lamp.", + "Swanky boots." + ), Item("gunnars_ground")) + } + player.inventory.add("antique_lamp_gunnars_ground") + player.inventory.add("swanky_boots") +} + +on({ operate && target.id == "gudrun_after_quest" && option == "Talk-to" }) { player: Player -> + when (player.quest("gunnars_ground")) { + "completed" -> { + npc("Hello!") + choice { + option("I want to ask you something.") { + npc("Of course, what is it?") + menu() + } + option("Just passing through.") { + npc("Goodbye!") + } + } + } + else -> player.message("error") + } +} +suspend fun CharacterContext.menu() { + choice { + option("How are things with Dororan?") { + npc("I really like him. he's funny, vulnerable and nothing like my people.") + choice { + option("You're going to stay together then?") { + npc("Of course!") + choice { + option("I want to ask about something else.") { + npc("Of course, what is it?") + menu() + } + option("Goodbye.") { + npc("Oh, Goodbye!") + } + } + } + option("I want to ask about something else.") { + npc("Of course, what is it?") + menu() + } + option("Goodbye.") { + npc("Oh, Goodbye!") + } + } + } + option("Where did this house come from?") { + npc("I don't know. Papa said the previous owners left it to him. I don't know why they would do that.") + theory() + } + option("Goodbye.") { + npc("Oh, Goodbye!") + } + } +} + +suspend fun CharacterContext.theory() { + choice { + option("Do you have a theory?") { + npc("Gunnar always said 'A warrior does not barter; he simply takes!'. I think papa bought the house, but doesn't want anyone to know.") + choice { + option("I want to ask about something else.") { + npc("Of course, what is it?") + menu() + } + option("Goodbye.") { + npc("Oh, Goodbye!") + } + } + } + option("I want to ask about something else.") { + npc("Of course, what is it?") + menu() + } + option("Goodbye.") { + npc("Oh, Goodbye!") + } + } +} \ No newline at end of file diff --git a/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Haakon.kts b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Haakon.kts new file mode 100644 index 000000000..035932659 --- /dev/null +++ b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Haakon.kts @@ -0,0 +1,54 @@ +package world.gregs.voidps.world.map.barbarian_village + +import world.gregs.voidps.engine.entity.character.CharacterContext +import world.gregs.voidps.engine.entity.character.npc.NPCOption +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.event.on +import world.gregs.voidps.world.activity.quest.quest +import world.gregs.voidps.world.interact.dialogue.* +import world.gregs.voidps.world.interact.dialogue.type.choice +import world.gregs.voidps.world.interact.dialogue.type.npc + +on({ operate && target.id == "haakon_the_champion" && option == "Talk-to" }) { player: Player -> + menu() +} + +suspend fun CharacterContext.menu() { + npc("I am Haakon, champion of this village. Do you seek to challenge me?") + choice { + option("I challenge you!") { + attack() + } + val validStages = setOf("tell_gudrun", "write_poem", "more_poem", "one_more_poem", "poem_done", "poem", "recital", "gunnars_ground") + if (validStages.contains(player.quest("gunnars_ground"))) { + option("You argued with Gunthor.") { + npc("There is no argument. I honour my father and my ancestors.") + choice { + option("Don't you want to settle permanently?") { + npc("You test my patience by quuestioning my loyalty to my chieftain. Take up my challenge, outerlander, that I might honourably split your skull open..") + choice { + option("I'll take your challenge!") { + attack() + } + option("No thanks.") { + } + } + } + option("How about that challenge?") { + attack() + } + option("Goodbye then.") { + } + + } + } + } + option("Er, no.") { + } + } +} + +suspend fun CharacterContext.attack() { + npc("Make peace with your god, outerlander!") + //todo make npc att you +} \ No newline at end of file diff --git a/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Kjell.kts b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Kjell.kts new file mode 100644 index 000000000..4d23d8642 --- /dev/null +++ b/game/src/main/kotlin/world/gregs/voidps/world/map/barbarian_village/Kjell.kts @@ -0,0 +1,93 @@ +package world.gregs.voidps.world.map.barbarian_village + +import world.gregs.voidps.engine.entity.character.CharacterContext +import world.gregs.voidps.engine.entity.character.npc.NPCOption +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.event.on +import world.gregs.voidps.type.random +import world.gregs.voidps.world.activity.quest.quest +import world.gregs.voidps.world.interact.dialogue.* +import world.gregs.voidps.world.interact.dialogue.type.choice +import world.gregs.voidps.world.interact.dialogue.type.npc + +on({ operate && target.id == "kjell" && option == "Talk-to" }) { player: Player -> + when (player.quest("gunnars_ground")) { + "gunnars_ground", "completed" -> { + completed() + } + "started" -> { + } + else -> unstarted() + } +} + +suspend fun CharacterContext.completed() { + when (random.nextInt(0, 8)) { + 0 -> { + npc("...there's a place for us...") + } + 1 -> { + npc("...but I'd do anything for you...") + } + 2 -> { + npc("...you exploded into my heart...") + } + 3 -> { + npc("...love you like the stars above...") + } + 4 -> { + npc("...I dreamed your dream for you...") + } + 5 -> { + npc("...there's a place for us...") + } + 5 -> { + npc("...fall for chains of gold...") + } + 6 -> { + npc("...when you gonna realise...") + } + 7 -> { + npc("...fall for pretty strangers...") + } + } + npc("Blast!") + choice { + option("Having trouble there?") { + npc("I don't need the advice of an outerlander.") + } + option("I'll leave you in peace.") { + } + } +} + +suspend fun CharacterContext.advice() { + choice { + option("This music isn't very restful.") { + npc("Get out of here!") + } + option("Maybe you should take some lessons.") { + npc("Get out of here!") + } + option("I'll leave you in peace.") { + npc("Get out of here!") + } + } +} + +suspend fun CharacterContext.unstarted() { + npc("Get out of here, outerlander!") + choice { + option("What is this place?") { + npc("The barbarian village. Go away.") + } + option("Who are you?") { + npc("My name is Kjell. Go away.") + } + option("What's in this hut you're guarding?") { + npc("Nothing yet. Once there is, no one will get in or out! Now, Go away!") + } + option("Goodbye then.") { + } + } +} diff --git a/game/src/main/kotlin/world/gregs/voidps/world/map/edgeville/Jeffery.kts b/game/src/main/kotlin/world/gregs/voidps/world/map/edgeville/Jeffery.kts new file mode 100644 index 000000000..f3a8bf1a9 --- /dev/null +++ b/game/src/main/kotlin/world/gregs/voidps/world/map/edgeville/Jeffery.kts @@ -0,0 +1,128 @@ +package world.gregs.voidps.world.map.edgeville + +import world.gregs.voidps.engine.entity.character.CharacterContext +import world.gregs.voidps.engine.entity.character.npc.NPCOption +import world.gregs.voidps.engine.entity.character.player.Player +import world.gregs.voidps.engine.entity.character.setAnimation +import world.gregs.voidps.engine.event.on +import world.gregs.voidps.engine.inv.equipment +import world.gregs.voidps.engine.inv.holdsItem +import world.gregs.voidps.engine.inv.inventory +import world.gregs.voidps.engine.inv.replace +import world.gregs.voidps.world.activity.quest.quest +import world.gregs.voidps.world.interact.dialogue.* +import world.gregs.voidps.world.interact.dialogue.type.* + +on({ operate && target.id == "jeffery" && option == "Talk-to" }) { player: Player -> + npc("Keep it quick. What do you want?") + choice { + if (player.quest("gunnars_ground") != "unstarted" && player.quest("gunnars_ground") != "started" && player.quest("gunnars_ground") != "love_poem") { + option("Who was that love poem for?") { + if (player.quest("gunnars_ground") == "completed") { + npc("It, er, it didn't work out well.") + npc("I don't want to talk about it! Leave me alone!") + } else { + npc("I haven't had a chance to do anything with it yet!") + } + } + } + if (player.quest("gunnars_ground") == "love_poem") { + option("I'm here about a gold ring.") { + npc("You want to buy a gold ring? You want to sell a gold ring? You want to ask pointless questions about gold rings?") + choice { + option("I was hoping you would trade me a gold ring.") { + npc("Trade you? Trade you for what?") + if (player.holdsItem("love_poem")) { + choice { + option("This splendid love poem.") { + lovePoem() + } + option("Some old love poem or something.") { + lovePoem() + } + } + } else { + player("Er...I meant to bring a poem as a trade, but I seem to have mislaid it. I'll go and find it.") + } + } + option("Actually, forget it.") { + } + } + } + } + option("I want to use the furnace.") { + //if has not done tasks to get Varrock armour + // npc("You want to use my furnace? I only let exceptional people use my furnace. You don't look exceptional to me.") + // player("How do I become exceptional?") + // npc("Exceptional people have earned exceptional items; earning Varrock armour would impress me.") + // player("Alright!") + //else + npc("You seem exceptional enough. Go ahead.") + player("What can I make here, exactly?") + npc("Well, depending on your skill as a blacksmith, you can use this furnace to smelt ore into metal bars.") + player("Oh, I see. What's so special about this furnace, then?") + npc("If you smelt at this furnace while wearing your Varrock armour the enchantment on the armour will give you a small chance of smelting two bars instead of one.") + player("I see. So, which metal will I be able to obtain more of when smelting with the armour I'm wearing?") + if (player.equipment.contains("varrock_armour_4")) { + npc("While wearing the Varrock armour, you will have a chance of smelting an extra bar of any metal up to, and including, rune.") + player("Oh, that's useful. That should save me a fair bit of time. Thanks very much.") + npc("Stay exceptional!") + } else if (player.equipment.contains("varrock_armour_3")) { + npc("While wearing the Varrock armour, you will have a chance of smelting an extra bar of any metal up to, and including, adamant.") + player("Oh, that's useful. That should save me a fair bit of time. Thanks very much.") + npc("Stay exceptional!") + } else if (player.equipment.contains("varrock_armour_2")) { + npc("While wearing the Varrock armour, you will have a chance of smelting an extra bar of any metal up to, and including, mithril.") + player("Oh, that's useful. That should save me a fair bit of time. Thanks very much.") + npc("Stay exceptional!") + } else if (player.equipment.contains("varrock_armour_1")) { + npc("While wearing the Varrock armour, you will have a chance of smelting an extra bar of any metal up to, and including, steel.") + player("Oh, that's useful. That should save me a fair bit of time. Thanks very much.") + npc("Stay exceptional!") + } else { + npc("Try coming back when you're actually wearing your Varrock armour.") + player("Oh, right. Yes I see. Okay, thanks.") + } + } + option("Er, nothing.") { + } + } +} + +suspend fun CharacterContext.lovePoem() { + npc("A love poem? What?") + npc("Wait...that dwarf put you up to this, didn't he?") + choice { + option("Yes, he did.") { + cheekyLittle() + } + option("I don't know any dwarf.") { + npc("I recognise his awful handwriting.") + cheekyLittle() + } + } +} + +suspend fun CharacterContext.cheekyLittle() { + npc("That cheeky little...") + npc("He just can't leave it alone, can he? Fine! I'll trade you for the poem. What is it you want?") + choice { + option("Just a plain, gold ring.") { + goldring() + } + option("The most valuable diamond ring you have.") { + npc("Well, all I have is this plain, gold ring.") + player("That will have to do.") + goldring() + } + } +} + +suspend fun CharacterContext.goldring() { + player.inventory.replace("love_poem", "ring_from_jeffery") + player["gunnars_ground"] = "jeffery_ring" + player.setAnimation("14737") + // npc.setAnimation("14738")//todo not working + items( "love_poem","ring_from_jeffery","Jeffery trades you a gold ring for the poem.") + npc("Now, leave me in peace!") +} \ No newline at end of file