Skip to content

Commit

Permalink
Enter the abyss mini-quest dialogue
Browse files Browse the repository at this point in the history
  • Loading branch information
GregHib committed May 9, 2024
1 parent c28ef37 commit ea60c02
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 44 deletions.
5 changes: 5 additions & 0 deletions data/definitions/variables-player-bit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,11 @@ minigame_type:
abyss_obstacles:
id: 625
format: int
enter_abyss_knows_mages:
id: 13728
format: boolean
persist: true
transmit: false
enter_abyss_where_runes:
id: 13731
format: boolean
Expand Down
1 change: 1 addition & 0 deletions data/spawns/npc-spawns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,7 @@
- { id: dark_wizard_earth_2, x: 3224, y: 3370 }
- { id: goblin_orange_hat_spear, x: 3259, y: 3338 }
- { id: tarquin, x: 3203, y: 3344 }
- { id: mage_of_zamorak_varrock, x: 3260, y: 3385, members: true }
# 12853
- { id: ash_cleaner, x: 3250, y: 3429 }
- { id: iffie, x: 3204, y: 3419 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ val quests = listOf(
"dorics_quest",
"gunnars_ground",
"rune_mysteries",
"the_knights_sword"
"the_knights_sword",
// mini-quests
"enter_the_abyss",
)

adminCommand("quests") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object EssenceMine {
val areas: AreaDefinitions = get()
val tile = areas["essence_mine"].random(player)!!
player.tele(tile)
if (player["into_the_abyss", "unstarted"] == "scrying") {
if (player["enter_the_abyss", "unstarted"] == "scrying") {
player["scrying_orb_${npc.id}"] = true
val count = player.variables.data.count { it.key.startsWith("scrying_orb_") }
if (count == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ npcOperate("Talk-to", "mage_of_zamorak_varrock") {
choice {
aboutAbyss()
aboutGroup()
option<Talk>("Nothing. I'm just looking around.")
option<Talk>("Nothing. I'm just looking around.") {
npc<Talk>("Very well.")
}
}
return@npcOperate
}
Expand Down Expand Up @@ -123,6 +125,7 @@ npcOperate("Talk-to", "mage_of_zamorak_varrock") {
}
} else if (player["enter_abyss_offer", false]) {
npc<Quiz>("You again. Have you considered my offer? If you help us access the Rune Essence Mine, we will share our runecrafting secrets with you in return.")
offer()
} else if (player["enter_abyss_where_runes", false]) {
npc<Talk>("Ah, you again. Do you need something?")
choice {
Expand Down Expand Up @@ -238,39 +241,19 @@ suspend fun NPCOption.accessLostMine() {
choice {
option<Talk>("I did it so that I could then steal their secrets.") {
npc<Uncertain>("You did? Perhaps I underestimated you.")
npc<Uncertain>("Alright, if you help us access the Rune Essence Mine, we will share our runecrafting secrets with you in return.")
player["enter_abyss_offer"] = true
deal()
}
option<Happy>("Okay, fine. I don't really serve Zamorak.") {
npc<Angry>("Then give me one good reason why I shouldn't have you teleported into the depths of a volcano!")
choice {
option<Talk>("Deal.") {
npc<Talk>("Good. Now, all I need from you is the spell that will teleport me to the Rune Essence Mine.")
npc<Uncertain>("Err... I don't actually know the spell.")
npc<Uncertain>("What? Then how do you get there.")
player<Talk>("Oh, well the people who do know the spell just teleport me there directly.")
npc<Talk>("Hmm... I see. That makes this slightly more complex, but no matter. You can still help us.")
player<Quiz>("How?")
npc<Talk>("I'll give you a scrying orb with a standard cypher spell cast upon it. The orb will absorb mystical energies that it is exposed to.")
npc<Talk>("If you teleport to the Rune Essence Mine from three different locations, the orb will absorb the energies of the spell and allow us to reverse-engineer the magic behind it.")
npc<Quiz>("Do you know of three different people who can teleport you there?")
player<Uncertain>("Maybe?")
npc<Talk>("Well if not, I'm sure one of those fools in the Order of Wizards can tell you. Now, here's the orb.")
if (!player.inventory.add("scrying_orb")) {
item("scrying_orb", 400, "The Mage of Zamorak tries to hand you an orb, but you don't have enough room to take it.")
} else {
item("scrying_orb", 400, "The Mage of Zamorak hands you an orb.")
player["enter_the_abyss"] = "scrying"
player["enter_abyss_has_orb"] = true
}
}
option<Talk>("No deal.") {
npc<Angry>("Fine. I will find another way.")
option<Talk>("Because I can still help you.") {
npc<Talk>("You would help both sides for your own gain? I suppose as a Zamorakian, I can respect that, even if I don't like it.")
deal()
}
option<Talk>("I need to think about it.") {
npc<Uncertain>("I will be here once you have decided.")
option<Talk>("Alright, I'll leave. Just don't go teleporting me anywhere.") {
npc<Angry>("Be glad that I am merciful! Now go!")
}
}
}
option<Happy>("Okay, fine. I don't really serve Zamorak.") {

}
option<Uncertain>("Sorry, I just remembered that I have to take my pet rat for a walk.") {
npc<Uncertain>("What?")
Expand All @@ -279,6 +262,12 @@ suspend fun NPCOption.accessLostMine() {
}
}

suspend fun NPCOption.deal() {
npc<Uncertain>("Alright, if you help us access the Rune Essence Mine, we will share our runecrafting secrets with you in return.")
player["enter_abyss_offer"] = true
offer()
}

fun teleport(player: Player, target: NPC) {
if (player.queue.contains(ActionPriority.Normal)) {
return
Expand All @@ -304,4 +293,36 @@ fun teleport(player: Player, target: NPC) {
player.tele(tile!!)
player.clearAnimation()
}
}

suspend fun NPCOption.offer() {
choice {
option<Talk>("Deal.") {
npc<Talk>("Good. Now, all I need from you is the spell that will teleport me to the Rune Essence Mine.")
player<Uncertain>("Err... I don't actually know the spell.")
npc<Uncertain>("What? Then how do you get there.")
player<Talk>("Oh, well the people who do know the spell just teleport me there directly.")
npc<Talk>("Hmm... I see. That makes this slightly more complex, but no matter. You can still help us.")
player<Quiz>("How?")
npc<Talk>("I'll give you a scrying orb with a standard cypher spell cast upon it. The orb will absorb mystical energies that it is exposed to.")
npc<Talk>("If you teleport to the Rune Essence Mine from three different locations, the orb will absorb the energies of the spell and allow us to reverse-engineer the magic behind it.")
npc<Quiz>("Do you know of three different people who can teleport you there?")
// TODO check if talking to sedridor beforehand changes this message
player<Uncertain>("Maybe?")
npc<Talk>("Well if not, I'm sure one of those fools in the Order of Wizards can tell you. Now, here's the orb.")
if (!player.inventory.add("scrying_orb")) {
item("scrying_orb", 400, "The Mage of Zamorak tries to hand you an orb, but you don't have enough room to take it.")
} else {
item("scrying_orb", 400, "The Mage of Zamorak hands you an orb.")
player["enter_the_abyss"] = "scrying"
player["enter_abyss_has_orb"] = true
}
}
option<Talk>("No deal.") {
npc<Angry>("Fine. I will find another way.")
}
option<Talk>("I need to think about it.") {
npc<Uncertain>("I will be here once you have decided.")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ package world.gregs.voidps.world.map.wizards_tower

import world.gregs.voidps.engine.client.message
import world.gregs.voidps.engine.entity.character.CharacterContext
import world.gregs.voidps.engine.entity.character.forceChat
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.npcOperate
import world.gregs.voidps.engine.entity.character.player.name
import world.gregs.voidps.engine.entity.character.setGraphic
import world.gregs.voidps.engine.entity.item.Item
import world.gregs.voidps.engine.inv.add
import world.gregs.voidps.engine.inv.holdsItem
Expand All @@ -19,6 +16,7 @@ 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.activity.quest.sendQuestComplete
import world.gregs.voidps.world.activity.skill.runecrafting.EssenceMine
import world.gregs.voidps.world.interact.dialogue.*
import world.gregs.voidps.world.interact.dialogue.type.*
import world.gregs.voidps.world.interact.entity.sound.playJingle
Expand All @@ -40,7 +38,7 @@ npcOperate("Talk-to", "sedridor") {
}

npcOperate("Teleport", "sedridor") {
teleport()
EssenceMine.teleport(target, player)
}

suspend fun CharacterContext.started() {
Expand Down Expand Up @@ -216,18 +214,12 @@ suspend fun NPCOption.completed() {
}

fun ChoiceBuilder<NPCOption>.teleportEssenceMine(): Unit = option<Quiz>("Can you teleport me to the Rune Essence Mine?") {
teleport()
}

fun NPCOption.teleport() {
target.forceChat = "Seventior Disthine Molenko!"
player.tele(2910, 4830)
target.setGraphic("curse_cast")
player.setGraphic("curse_hit")
EssenceMine.teleport(target, player)
}

suspend fun ChoiceBuilder<NPCOption>.whoElseKnows(): Unit = option<Quiz>("Who else knows the teleport to the Rune Essence Mine?") {
npc<Happy>("Apart from myself, there's also Aubury in Varrock, Wizard Cromperty in East Ardougne, Brimstail in the Tree Gnome Stronghold and Wizard Distentor in Yanille's Wizards' Guild.")
player["enter_abyss_knows_mages"] = true
choice {
teleportEssenceMine()
oldWizardsTower()
Expand Down

0 comments on commit ea60c02

Please sign in to comment.