Implemented Observatory Quest
This commit is contained in:
@@ -70,7 +70,7 @@ class ChampionScrollsDropHandler : ChampionScrollsEventHookBase() {
|
||||
|
||||
NPCs.CAVE_GOBLIN_GUARD_2073, NPCs.CAVE_GOBLIN_GUARD_2074,
|
||||
|
||||
NPCs.GOBLIN_GUARD_489, NPCs.GOBLIN_GUARD_6496, NPCs.GOBLIN_GUARD_6497,
|
||||
NPCs.GOBLIN_GUARD_6496, NPCs.GOBLIN_GUARD_6497,
|
||||
NPCs.SERGEANT_GRIMSPIKE_6265,
|
||||
NPCs.SERGEANT_STEELWILL_6263,
|
||||
NPCs.SERGEANT_STRONGSTACK_6261
|
||||
|
||||
@@ -15,7 +15,7 @@ public final class GuardNPC extends AbstractNPC {
|
||||
/**
|
||||
* The NPC ids of NPCs using this plugin.
|
||||
*/
|
||||
private static final int[] ID = { 9, 32, 163, 164, 196, 197, 206, 253, 254, 255, 256, 274, 275, 296, 298, 299, 447, 448, 449, 489, 609, 678, 799, 837, 842, 862, 870, 877, 917, 1200, 1203, 1204, 1317, 1710, 1711, 1712, 2073, 2074, 2134, 2135, 2136, 2236, 2571, 2699, 2700, 2701, 2702, 2703, 3228, 3229, 3230, 3231, 3232, 3233, 3241, 3407, 3408, 3715, 4257, 4258, 4259, 4260, 4307, 4308, 4309, 4310, 4311, 4336, 4375, 4603, 4604, 4605, 4606, 5800, 5801, 5919, 5920 };
|
||||
private static final int[] ID = { 9, 32, 163, 164, 196, 197, 206, 253, 254, 255, 256, 274, 275, 296, 298, 299, 447, 448, 449, 609, 678, 799, 837, 842, 862, 870, 877, 917, 1200, 1203, 1204, 1317, 1710, 1711, 1712, 2073, 2074, 2134, 2135, 2136, 2236, 2571, 2699, 2700, 2701, 2702, 2703, 3228, 3229, 3230, 3231, 3232, 3233, 3241, 3407, 3408, 3715, 4257, 4258, 4259, 4260, 4307, 4308, 4309, 4310, 4311, 4336, 4375, 4603, 4604, 4605, 4606, 5800, 5801, 5919, 5920 };
|
||||
|
||||
/**
|
||||
* Constructs a new {@code GuardNPC} {@code Object}.
|
||||
|
||||
@@ -27,7 +27,7 @@ enum class SilverProduct(
|
||||
val strungId: Int
|
||||
) {
|
||||
HOLY(BUTTON_UNBLESSED, Items.HOLY_MOULD_1599, Items.UNSTRUNG_SYMBOL_1714, 1, 16, 50.0, Items.UNBLESSED_SYMBOL_1716),
|
||||
UNHOLY(BUTTON_UNHOLY, Items.UNHOLY_MOULD_1594, Items.UNSTRUNG_EMBLEM_1720, 1, 17, 50.0, Items.UNHOLY_SYMBOL_1724),
|
||||
UNHOLY(BUTTON_UNHOLY, Items.UNHOLY_MOULD_1594, Items.UNSTRUNG_EMBLEM_1720, 1, 17, 50.0, Items.UNPOWERED_SYMBOL_1722),
|
||||
SICKLE(BUTTON_SICKLE, Items.SICKLE_MOULD_2976, Items.SILVER_SICKLE_2961, 1, 18, 50.0, -1),
|
||||
TIARA(BUTTON_TIARA, Items.TIARA_MOULD_5523, Items.TIARA_5525, 1, 23, 52.5, -1),
|
||||
SILVTHRIL_CHAIN(BUTTON_SILVTHRIL_CHAIN, Items.CHAIN_LINK_MOULD_13153, Items.SILVTHRIL_CHAIN_13154, 1, 47, 100.0, -1),
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
package content.region.kandarin.dialogue
|
||||
|
||||
import content.global.handlers.iface.BookInterface
|
||||
import content.global.handlers.iface.BookLine
|
||||
import content.global.handlers.iface.Page
|
||||
import content.global.handlers.iface.PageSet
|
||||
import core.ServerConstants
|
||||
import core.api.setAttribute
|
||||
import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.node.entity.player.Player
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
|
||||
@Initializable
|
||||
class AstronomyBook : InteractionListener {
|
||||
companion object {
|
||||
private val TITLE = "The tales of Scorpius"
|
||||
private val CONTENTS = arrayOf(
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("A History of Astronomy", 55),
|
||||
BookLine("in ${ServerConstants.SERVER_NAME}.", 56),
|
||||
BookLine("", 57),
|
||||
BookLine("At the start of the 4th age,", 58),
|
||||
BookLine("a learned man by the", 59),
|
||||
BookLine("name of Scorpius, known well", 60),
|
||||
BookLine("for his powers of vision and", 61),
|
||||
BookLine("magic, sought communion with", 62),
|
||||
BookLine("the gods of the world.", 63),
|
||||
BookLine("So many unanswered questions", 64),
|
||||
BookLine("had he that devoted his entire", 65),
|
||||
),
|
||||
Page(
|
||||
BookLine("life to this cause.", 66),
|
||||
BookLine("After many years of study,", 67),
|
||||
BookLine("seeking knowledge from the", 68),
|
||||
BookLine("wise of that time, he developed", 69),
|
||||
BookLine("a machine infused with", 70),
|
||||
BookLine("magical power, infused with", 71),
|
||||
BookLine("the ability to pierce", 72),
|
||||
BookLine("into the heavens - a huge eye", 73),
|
||||
BookLine("that gave the user", 74),
|
||||
BookLine("incredible site, like never", 75),
|
||||
BookLine("seen before.", 76),
|
||||
)
|
||||
),
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("As time passed, Scorpius", 55),
|
||||
BookLine("grew adept at using his", 56),
|
||||
BookLine("specialized skills, and followed", 57),
|
||||
BookLine("the movements of stars", 58),
|
||||
BookLine("in ${ServerConstants.SERVER_NAME}, which are", 59),
|
||||
BookLine("mapped and named, and still", 60),
|
||||
BookLine("used to this day.", 61),
|
||||
BookLine("", 62),
|
||||
BookLine("Before long, Scorpius", 63),
|
||||
BookLine("used his knowledge", 64),
|
||||
BookLine("for predicting the future,", 65),
|
||||
),
|
||||
Page(
|
||||
BookLine("and, in turn, he called upon", 66),
|
||||
BookLine("the dark knowledge of", 67),
|
||||
BookLine("Zamorakian worshipers", 68),
|
||||
BookLine("to further his cause. Living", 69),
|
||||
BookLine("underground, the followers", 70),
|
||||
BookLine("of the dark god remained", 71),
|
||||
BookLine("until the civilization of", 72),
|
||||
BookLine("Ardougne grew in strength", 73),
|
||||
BookLine("and control.", 74),
|
||||
)
|
||||
),
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("The kings of that time", 55),
|
||||
BookLine("worked to banish the", 56),
|
||||
BookLine("Zamorakian followers in", 57),
|
||||
BookLine("the area, hiding all", 58),
|
||||
BookLine("reference to Scorpius's", 59),
|
||||
BookLine("invention, due to", 60),
|
||||
BookLine("its 'evil nature'.", 61),
|
||||
BookLine("", 62),
|
||||
BookLine("Years later, when the", 63),
|
||||
BookLine("minds of the kings lent", 64),
|
||||
BookLine("more towards the research", 65),
|
||||
),
|
||||
Page(
|
||||
BookLine("of the unknown, the plans", 66),
|
||||
BookLine("of Scorpius were uncovered", 67),
|
||||
BookLine("and the heavenly eye", 68),
|
||||
BookLine("constructed again. Since then,", 69),
|
||||
BookLine("many have studied the ways of", 70),
|
||||
BookLine("the astronomer, Scorpius", 71),
|
||||
BookLine("and in his memory a grave", 72),
|
||||
BookLine("was constructed near the", 73),
|
||||
BookLine("Observatory. Some claim his", 74),
|
||||
BookLine("ghost still wanders nearby,", 75),
|
||||
BookLine("in torment as he seeks", 76),
|
||||
)
|
||||
),
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("the secrets of the heavens", 55),
|
||||
BookLine("that can never be solved.", 56),
|
||||
BookLine("Tales tell that he will", 57),
|
||||
BookLine("grant those adept in the", 58),
|
||||
BookLine("arts of the astronomer a", 59),
|
||||
BookLine("blessing of unusual power.", 60),
|
||||
BookLine("", 61),
|
||||
BookLine("Here ends the tale of", 62),
|
||||
BookLine("how astronomy entered", 63),
|
||||
BookLine("the known world.", 64),
|
||||
)
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
private fun display(player: Player, pageNum: Int, buttonID: Int): Boolean {
|
||||
BookInterface.pageSetup(player, BookInterface.FANCY_BOOK_3_49, TITLE, CONTENTS)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun defineListeners() {
|
||||
on(Items.ASTRONOMY_BOOK_600, IntType.ITEM, "read") { player, _ ->
|
||||
BookInterface.openBook(player, BookInterface.FANCY_BOOK_3_49, ::display)
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import content.global.handlers.iface.*
|
||||
import core.ServerConstants
|
||||
import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.node.entity.player.Player
|
||||
import org.rs09.consts.Items
|
||||
|
||||
/**
|
||||
* Astronomy Book
|
||||
*/
|
||||
class AstronomyBook : InteractionListener {
|
||||
companion object {
|
||||
private const val TITLE = "THE TALE OF SCORPIUS"
|
||||
private val CONTENTS = arrayOf(
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("THE TALE OF", 55),
|
||||
BookLine("SCORPIUS: ", 56),
|
||||
BookLine("", 57),
|
||||
BookLine("A History of Astronomy", 58),
|
||||
BookLine("in ${ServerConstants.SERVER_NAME}.", 59),
|
||||
BookLine("", 60),
|
||||
BookLine("At the start of the 4th", 61),
|
||||
BookLine("Age, a learned man by", 62),
|
||||
BookLine("the name of Scorpius,", 63),
|
||||
BookLine("known well for his powers", 64),
|
||||
BookLine("of vision and magic,", 65),
|
||||
),
|
||||
Page(
|
||||
BookLine("sought communion with", 66),
|
||||
BookLine("the gods of the world. So", 67),
|
||||
BookLine("many unanswered", 68),
|
||||
BookLine("questions had he that he", 69),
|
||||
BookLine("devoted his entire lif to", 70),
|
||||
BookLine("the cause.", 71),
|
||||
BookLine("", 72),
|
||||
BookLine("After many years of", 73),
|
||||
BookLine("study, seeking knowledge", 74),
|
||||
BookLine("from the wise of that", 75),
|
||||
BookLine("time, he developed a", 76),
|
||||
)
|
||||
),
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("machine infused with", 55),
|
||||
BookLine("magical power, infused", 56),
|
||||
BookLine("with the ability to pierce", 57),
|
||||
BookLine("into the very heavens - a", 58),
|
||||
BookLine("huge eye that gave the", 59),
|
||||
BookLine("user incredible sight, like", 60),
|
||||
BookLine("never before.", 61),
|
||||
BookLine("", 62),
|
||||
BookLine("", 63),
|
||||
BookLine("", 64),
|
||||
BookLine("", 65),
|
||||
),
|
||||
Page(
|
||||
BookLine("As time passed, Scorpius", 66),
|
||||
BookLine("grew adept at using his", 67),
|
||||
BookLine("specialized skills, and", 68),
|
||||
BookLine("followed the movements of", 69),
|
||||
BookLine("the stars in ${ServerConstants.SERVER_NAME}", 70),
|
||||
BookLine("which he mapped and", 71),
|
||||
BookLine("named, and are still used", 72),
|
||||
BookLine("to this very day.", 73),
|
||||
BookLine("", 74),
|
||||
BookLine("Before long, Scorpius", 75),
|
||||
BookLine("used his knowledge for", 76),
|
||||
)
|
||||
),
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("predicting the future,", 55),
|
||||
BookLine("and, in turn, he called", 56),
|
||||
BookLine("upon the dark knowledge", 57),
|
||||
BookLine("of Zamorakian", 58),
|
||||
BookLine("worshippers to further his", 59),
|
||||
BookLine("cause. Living below", 60),
|
||||
BookLine("ground, the followers of", 61),
|
||||
BookLine("the dark god remained", 62),
|
||||
BookLine("until the civilisation of", 63),
|
||||
BookLine("Ardougne grew in", 64),
|
||||
BookLine("strength and control.", 65),
|
||||
),
|
||||
Page(
|
||||
BookLine("", 66),
|
||||
BookLine("", 67),
|
||||
BookLine("", 68),
|
||||
BookLine("", 69),
|
||||
BookLine("", 70),
|
||||
BookLine("", 71),
|
||||
BookLine("The kings of that time", 72),
|
||||
BookLine("worked to banish the", 73),
|
||||
BookLine("Zamorakian followers in", 74),
|
||||
BookLine("the area, hiding all", 75),
|
||||
BookLine("references to Scorpius's", 76),
|
||||
)
|
||||
),
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("invention, due to its 'evil", 55),
|
||||
BookLine("nature'.", 56),
|
||||
BookLine("", 57),
|
||||
BookLine("Years after, when the", 58),
|
||||
BookLine("minds of the kings lent", 59),
|
||||
BookLine("more towards the", 60),
|
||||
BookLine("research of the unknown,", 61),
|
||||
BookLine("the plans of Scorpius", 62),
|
||||
BookLine("were uncovered and the", 63),
|
||||
BookLine("heavenly eye constructed", 64),
|
||||
BookLine("again.", 65),
|
||||
),
|
||||
Page(
|
||||
BookLine("Since then, many have", 66),
|
||||
BookLine("studied the ways of the", 67),
|
||||
BookLine("astronomer, Scorpius, and", 68),
|
||||
BookLine("in his memory a grave", 69),
|
||||
BookLine("was constructed near the", 70),
|
||||
BookLine("Observatory.", 71),
|
||||
BookLine("", 72),
|
||||
BookLine("", 73),
|
||||
BookLine("", 74),
|
||||
BookLine("", 75),
|
||||
BookLine("", 76),
|
||||
)
|
||||
),
|
||||
|
||||
PageSet(
|
||||
Page(),
|
||||
Page(
|
||||
BookLine("Some claim his ghost still", 66),
|
||||
BookLine("wanders nearby, in", 67),
|
||||
BookLine("torment as he seeks the", 68),
|
||||
BookLine("secrets of the heavens", 69),
|
||||
BookLine("that can never be solved.", 70),
|
||||
BookLine("Tales tell that he will", 71),
|
||||
BookLine("grant those adept in the", 72),
|
||||
BookLine("arts of the astronomer a", 73),
|
||||
BookLine("blessing of unusual", 74),
|
||||
BookLine("power.", 75),
|
||||
BookLine("", 76),
|
||||
)
|
||||
),
|
||||
PageSet(
|
||||
Page(
|
||||
BookLine("Here ends the tale of how", 55),
|
||||
BookLine("astronomy entered the", 56),
|
||||
BookLine("known world.", 57),
|
||||
),
|
||||
Page()
|
||||
),
|
||||
)
|
||||
private fun display(player:Player, pageNum: Int, buttonID: Int) : Boolean {
|
||||
BookInterface.pageSetup(player, BookInterface.FANCY_BOOK_3_49, TITLE, CONTENTS)
|
||||
BookInterface.setModelOnPage(player,2, 27071, BookInterface.FANCY_BOOK_3_49, 33, 34, 1020, 0, 0)
|
||||
BookInterface.setModelOnPage(player,4, 27069, BookInterface.FANCY_BOOK_3_49, 17, 18, 1224, 0, 0)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
override fun defineListeners() {
|
||||
on(Items.ASTRONOMY_BOOK_600, IntType.ITEM, "read") { player, _ ->
|
||||
BookInterface.openBook(player, BookInterface.FANCY_BOOK_3_49, ::display)
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import core.api.*
|
||||
import core.game.dialogue.*
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.node.entity.npc.AbstractNPC
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.world.map.Location
|
||||
import core.plugin.Initializable
|
||||
import core.tools.RandomFunction
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
class GoblinDialogues : InteractionListener {
|
||||
override fun defineListeners() {
|
||||
on(NPCs.GREASYCHEEKS_6127, NPC, "talk-to") { player, node ->
|
||||
openDialogue(player, GreasycheeksDialogueFile(), node as NPC)
|
||||
return@on true
|
||||
}
|
||||
on(NPCs.SMELLYTOES_6128, NPC, "talk-to") { player, node ->
|
||||
openDialogue(player, SmellytoesDialogueFile(), node as NPC)
|
||||
return@on true
|
||||
}
|
||||
on(NPCs.CREAKYKNEES_6129, NPC, "talk-to") { player, node ->
|
||||
openDialogue(player, CreakykneesDialogueFile(), node as NPC)
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GreasycheeksDialogueFile : DialogueLabeller() {
|
||||
override fun addConversation() {
|
||||
assignToIds(NPCs.GREASYCHEEKS_6127)
|
||||
player("Hello.")
|
||||
npc(ChatAnim.OLD_NORMAL, "Shush! I'm concentrating.")
|
||||
player("Oh, sorry.")
|
||||
}
|
||||
}
|
||||
|
||||
class SmellytoesDialogueFile : DialogueLabeller() {
|
||||
override fun addConversation() {
|
||||
assignToIds(NPCs.SMELLYTOES_6128)
|
||||
player("Hi there.")
|
||||
npc(ChatAnim.OLD_NORMAL, "Hey, ids me matesh!")
|
||||
player("Sorry, have we met?")
|
||||
npc(ChatAnim.OLD_NORMAL, "Yeah! you wazsh wiv me in dat pub overy by hill!")
|
||||
player("I have no idea what you're going on about.")
|
||||
npc(ChatAnim.OLD_NORMAL, "Glad yeeash remembers.")
|
||||
}
|
||||
}
|
||||
|
||||
class CreakykneesDialogueFile : DialogueLabeller() {
|
||||
override fun addConversation() {
|
||||
assignToIds(NPCs.CREAKYKNEES_6129)
|
||||
player("Where did you get that lens?")
|
||||
npc(ChatAnim.OLD_NORMAL, "From that strange metal thing up on the hill.")
|
||||
player(ChatAnim.ANGRY, "You should give that back!")
|
||||
npc(ChatAnim.OLD_NORMAL, "Even if it's cracked?")
|
||||
player("Ah, well, I suppose it's of no use. But, still.")
|
||||
}
|
||||
}
|
||||
|
||||
@Initializable
|
||||
class GreasycheeksNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
|
||||
override fun construct(id: Int, location: Location?, vararg objects: Any?): AbstractNPC {
|
||||
return GreasycheeksNPC(id, location)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.GREASYCHEEKS_6127)
|
||||
}
|
||||
|
||||
override fun handleTickActions() {
|
||||
super.handleTickActions()
|
||||
if (RandomFunction.roll(12)) {
|
||||
sendChat(this, arrayOf(
|
||||
"Cook, cook, cook!",
|
||||
"I'm so hungry!",
|
||||
"This is gonna taste sooo good!",
|
||||
).random())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Initializable
|
||||
class SmellytoesNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
|
||||
override fun construct(id: Int, location: Location?, vararg objects: Any?): AbstractNPC {
|
||||
return SmellytoesNPC(id, location)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.SMELLYTOES_6128)
|
||||
}
|
||||
|
||||
override fun handleTickActions() {
|
||||
super.handleTickActions()
|
||||
if (RandomFunction.roll(12)) {
|
||||
sendChat(this, arrayOf(
|
||||
"Doh ray meeee laa doh faaa!",
|
||||
"La la la! Do di dum dii!",
|
||||
).random())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Initializable
|
||||
class CreakykneesNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
|
||||
override fun construct(id: Int, location: Location?, vararg objects: Any?): AbstractNPC {
|
||||
return CreakykneesNPC(id, location)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.CREAKYKNEES_6129)
|
||||
}
|
||||
|
||||
override fun handleTickActions() {
|
||||
super.handleTickActions()
|
||||
if (RandomFunction.roll(12)) {
|
||||
sendChat(this, arrayOf(
|
||||
"Was that a spark?",
|
||||
"Come on! Please light!",
|
||||
).random())
|
||||
}
|
||||
}
|
||||
}
|
||||
@Initializable
|
||||
class LostGoblinNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
|
||||
override fun construct(id: Int, location: Location?, vararg objects: Any?): AbstractNPC {
|
||||
return LostGoblinNPC(id, location)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.GOBLIN_6125)
|
||||
}
|
||||
|
||||
override fun handleTickActions() {
|
||||
super.handleTickActions()
|
||||
if (RandomFunction.roll(12)) {
|
||||
sendChat(this, arrayOf(
|
||||
"Which way should I go?",
|
||||
"These dungeons are such a maze.",
|
||||
"Where's the exit?!?",
|
||||
"This is the fifth time this week. I'm lost!",
|
||||
"I've been wandering around down here for hours.",
|
||||
"How do you get back to the village?",
|
||||
"I hate being so lost!",
|
||||
"How could I be so disoriented?",
|
||||
"Where am I? I'm so lost.",
|
||||
"I know the exit's around here, somewhere."
|
||||
).random())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import content.data.Quests
|
||||
import core.api.*
|
||||
import core.game.node.entity.Entity
|
||||
import core.game.node.entity.npc.AbstractNPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.Location
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class GoblinGuardNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
|
||||
override fun construct(id: Int, location: Location, vararg objects: Any): AbstractNPC {
|
||||
return GoblinGuardNPC(id, location)
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.SLEEPING_GUARD_6122, NPCs.GOBLIN_GUARD_489)
|
||||
}
|
||||
|
||||
override fun finalizeDeath(entity: Entity) {
|
||||
if (entity is Player) {
|
||||
val player = entity.asPlayer()
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) >= 4) {
|
||||
setAttribute(player, ObservatoryQuest.attributeKilledGuard, true)
|
||||
}
|
||||
super.finalizeDeath(player)
|
||||
}
|
||||
}
|
||||
}
|
||||
+238
@@ -0,0 +1,238 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import content.data.Quests
|
||||
import content.region.kandarin.quest.observatoryquest.ObservatoryQuest.Companion.attributeReceivedWine
|
||||
import core.api.*
|
||||
import core.game.dialogue.*
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class ObservatoryAssistantDialogue (player: Player? = null) : DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player): DialoguePlugin {
|
||||
return ObservatoryAssistantDialogue(player)
|
||||
}
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
openDialogue(player, ObservatoryAssistantDialogueFile(), npc)
|
||||
return false
|
||||
}
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.OBSERVATORY_ASSISTANT_6118, 10022)
|
||||
}
|
||||
}
|
||||
|
||||
class ObservatoryAssistantDialogueFile : DialogueLabeller() {
|
||||
override fun addConversation() {
|
||||
assignToIds(NPCs.OBSERVATORY_ASSISTANT_6118)
|
||||
|
||||
exec { player, npc ->
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 0) {
|
||||
loadLabel(player, "observatoryQuest0")
|
||||
} else if (getAttribute(player, attributeReceivedWine, false)) {
|
||||
loadLabel(player, "receivedwine")
|
||||
} else if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 100) {
|
||||
loadLabel(player, "observatoryqueststage100")
|
||||
} else {
|
||||
loadLabel(player, "randomStart" + (1..4).random())
|
||||
}
|
||||
}
|
||||
|
||||
label("observatoryQuest0")
|
||||
player(FacialExpression.ASKING, "Hi, are you busy?")
|
||||
npc("Me? I'm always busy.")
|
||||
npc("See that man there? That's the professor. If he had his way, I think he'd never let me sleep!")
|
||||
npc("Anyway, how might I help you?")
|
||||
options(
|
||||
DialogueOption("wonderingwhat", "I was wondering what you do here."),
|
||||
DialogueOption("justlooking", "Just looking around, thanks."),
|
||||
DialogueOption("looktelescope", "Can I have a look through that telescope?", expression = FacialExpression.ASKING)
|
||||
)
|
||||
|
||||
label("wonderingwhat")
|
||||
npc("Glad you ask. This is the Observatory reception. Up on the cliff is the Observatory dome, from which you can view the heavens. Usually...")
|
||||
player(FacialExpression.ASKING, "What do you mean, 'usually'?")
|
||||
npc("*Ahem*. Back to work, please.")
|
||||
npc("I'd speak with the professor. He'll explain.")
|
||||
|
||||
label("justlooking")
|
||||
npc("Okay, just don't break anything. If you need any help, let me know.")
|
||||
line("The assistant continues with his work.")
|
||||
|
||||
label("looktelescope")
|
||||
npc("You can. You won't see much though.")
|
||||
player(FacialExpression.ASKING, "And that's because?")
|
||||
npc("Just talk to the professor. He'll fill you in.")
|
||||
|
||||
label("randomStart1")
|
||||
player(FacialExpression.ASKING, "Can I interrupt you?")
|
||||
npc("I suppose so. Please be quick though.")
|
||||
goto("afterRandomStart")
|
||||
|
||||
label("randomStart2")
|
||||
player(FacialExpression.ASKING, "Might I have a word?")
|
||||
npc("Sure, how can I help you?")
|
||||
goto("afterRandomStart")
|
||||
|
||||
label("randomStart3")
|
||||
player("Hello there.")
|
||||
npc("Yes?")
|
||||
goto("afterRandomStart")
|
||||
|
||||
label("randomStart4")
|
||||
player(FacialExpression.ASKING, "Can I speak with you?")
|
||||
npc("Why, of course. What is it?")
|
||||
goto("afterRandomStart")
|
||||
|
||||
|
||||
label("afterRandomStart")
|
||||
exec { player, npc ->
|
||||
loadLabel(player, "observatoryqueststage" + getQuestStage(player, Quests.OBSERVATORY_QUEST))
|
||||
}
|
||||
|
||||
label("observatoryqueststage1")
|
||||
exec { player, _ ->
|
||||
if (inInventory(player, Items.PLANK_960, 3)) {
|
||||
loadLabel(player, "enoughplanks")
|
||||
}
|
||||
else if (inInventory(player, Items.PLANK_960)) {
|
||||
loadLabel(player, "someplanks")
|
||||
}
|
||||
else {
|
||||
loadLabel(player, "notenoughplanks")
|
||||
}
|
||||
}
|
||||
|
||||
label("notenoughplanks")
|
||||
player(FacialExpression.ASKING,"Where can I find planks of wood? I need some for the telescope's base.")
|
||||
npc("I understand planks can be found at Port Khazard, to the east of here. There are some at the Barbarian Outpost, too.")
|
||||
npc("Failing that, you could always ask the Sawmill Operator. He's to the north-east of Varrock, by the Lumber Yard.")
|
||||
|
||||
label("enoughplanks")
|
||||
player("I've got some planks for the telescope's base.")
|
||||
npc("Good work! The professor has been eagerly awaiting them.")
|
||||
|
||||
label("someplanks")
|
||||
player("I've got a plank.")
|
||||
npc("That's nice.")
|
||||
player("You know, for the telescope's base.")
|
||||
npc("Well done. Remember that you'll need three in total.")
|
||||
|
||||
label("observatoryqueststage2")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.BRONZE_BAR_2349)) {
|
||||
loadLabel(player, "hasbronzebar")
|
||||
} else {
|
||||
loadLabel(player, "nohasbronzebar")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohasbronzebar")
|
||||
player(FacialExpression.ASKING, "Can you help me? How do I go about getting a bronze bar?")
|
||||
npc("You'll need to use tin and copper ore on a furnace to produce this metal.")
|
||||
player("Right you are.")
|
||||
|
||||
label("hasbronzebar")
|
||||
player("The bronze bar is ready, and waiting for the professor.")
|
||||
npc("He'll surely be pleased. Go ahead and give it to him.")
|
||||
|
||||
label("observatoryqueststage3")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.MOLTEN_GLASS_1775)) {
|
||||
loadLabel(player, "hasmoltenglass")
|
||||
} else {
|
||||
loadLabel(player, "nohasmoltenglass")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohasmoltenglass")
|
||||
player(FacialExpression.ASKING, "What's the best way for me to get molten glass?")
|
||||
npc("There are many ways, but I'd suggest making it yourself. Get yourself a bucket of sand and some soda ash, which you can get from using seaweed with a furnace. Use the soda ash and sand together in a")
|
||||
npc("furnace and bang - molten glass is all yours. There's a book about it on the table if you want to know more.")
|
||||
player("Thank you!")
|
||||
|
||||
label("hasmoltenglass")
|
||||
player("I've managed to get hold of some molten glass.")
|
||||
npc("I suggest you have a word with the professor, in that case.")
|
||||
|
||||
label("observatoryqueststage4")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.LENS_MOULD_602)) {
|
||||
loadLabel(player, "haslensmould")
|
||||
} else {
|
||||
loadLabel(player, "nohaslensmould")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohaslensmould")
|
||||
player(FacialExpression.ASKING, "Where can I find this lens mould you mentioned?")
|
||||
npc("I'm sure I heard one of those goblins talking about it. I bet they've hidden it somewhere. Probably using it for some strange purpose, I'm sure.")
|
||||
player(FacialExpression.ASKING, "What makes you say that?")
|
||||
npc("I had a nice new star chart, until recently. I went out to do an errand for the professor the other day, only to see a goblin using it...")
|
||||
npc("...as some kind of makeshift hankey to blow his nose!")
|
||||
player("Oh dear.")
|
||||
npc("You may want to look through the dungeon they have under their little village.")
|
||||
player("Thanks for the advice.")
|
||||
|
||||
label("haslensmould")
|
||||
player("I have the lens mould.")
|
||||
npc("Well done on finding that! I am honestly quite impressed. Make sure you take it straight to the professor.")
|
||||
player("Will do.")
|
||||
|
||||
label("observatoryqueststage5")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.OBSERVATORY_LENS_603)) {
|
||||
loadLabel(player, "haslens")
|
||||
} else {
|
||||
loadLabel(player, "nohaslens")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohaslens")
|
||||
player(FacialExpression.ASKING, "How should I make this lens?")
|
||||
npc("Just use the molten glass with the mould. Simple.")
|
||||
player("Thanks!")
|
||||
|
||||
label("haslens")
|
||||
player("Do you like this lens? Good, huh?")
|
||||
npc("Nice. What's that scratch?")
|
||||
player("Oh, erm, that's a feature.")
|
||||
player("Yes, that's it! Indubitably, it facilitates the triangulation of photonic illumination to the correct...")
|
||||
npc("Stop! You can't confuse me with big words. Just pray the professor doesn't notice.")
|
||||
|
||||
label("observatoryqueststage6")
|
||||
player("Hello again.")
|
||||
npc("Ah, it's the telescope repairman! The professor is waiting for you in the Observatory.")
|
||||
player("How can I get to the Observatory?")
|
||||
npc("Well, since the bridge was ruined, you will have to travel through the dungeon under the goblins' settlement.")
|
||||
|
||||
label("observatoryqueststage100")
|
||||
player("Hi assistant.")
|
||||
player("Wait a minute.")
|
||||
player(FacialExpression.ASKING, "What's your real name?")
|
||||
npc(FacialExpression.ASKING, "My real name?")
|
||||
player(FacialExpression.ASKING, "I only know you as the professor's assistant. What's your actual name?")
|
||||
npc("Patrick.")
|
||||
player("Hi Patrick, I'm @name.")
|
||||
npc("Well, hello again, and thanks for helping out the professor.")
|
||||
npc(" Oh, and, believe it or not, his name is Mambo-duna-roona, but don't tell him I told you.")
|
||||
player(FacialExpression.AMAZED, "You made that up!")
|
||||
npc("No, honest! Anyways, you've made my life much easier. Have a drink on me!")
|
||||
item(Item(Items.JUG_OF_WINE_1993), "The assistant gives you some wine.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.JUG_OF_WINE_1993)
|
||||
setAttribute(player, attributeReceivedWine, true)
|
||||
}
|
||||
player("Thanks very much.")
|
||||
npc("No problem. Scorpius would be proud.")
|
||||
player(FacialExpression.ASKING, "Sorry?")
|
||||
npc("You may want to check out that book on the table, and perhaps look around for a grave...")
|
||||
|
||||
label("receivedwine")
|
||||
npc(FacialExpression.ASKING, "How was the wine?")
|
||||
player(FacialExpression.DRUNK, "That was good stuff, *hic*! Wheresh the professher?")
|
||||
npc(FacialExpression.ASKING, "The professor? He's up in the Observatory. Since the bridge was ruined, you will have to travel through the dungeon under the goblins' settlement.")
|
||||
}
|
||||
}
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import core.api.*
|
||||
import core.game.activity.Cutscene
|
||||
import core.game.dialogue.FacialExpression
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.world.map.Direction
|
||||
import org.rs09.consts.Animations
|
||||
import org.rs09.consts.NPCs
|
||||
import content.region.kandarin.quest.observatoryquest.ObservatoryQuest.Companion.attributeFinishedCutscene
|
||||
import core.game.world.map.Location
|
||||
|
||||
class ObservatoryCutscene(player: Player) : Cutscene(player) {
|
||||
override fun setup() {
|
||||
setExit(Location(2438, 3163))
|
||||
loadRegion(9777)
|
||||
addNPC(PROFESSOR, 7, 25, Direction.SOUTH)
|
||||
}
|
||||
|
||||
override fun runStage(stage: Int) {
|
||||
when (stage) {
|
||||
0 -> {
|
||||
fadeToBlack()
|
||||
timedUpdate(5)
|
||||
}
|
||||
1 -> {
|
||||
teleport(player, 6, 27)
|
||||
face(player, getNPC(PROFESSOR)!!.location)
|
||||
rotateCamera(9, 25, 300)
|
||||
moveCamera(25, 22, 1800)
|
||||
timedUpdate(5)
|
||||
}
|
||||
2 -> {
|
||||
fadeFromBlack()
|
||||
dialogueLinesUpdate("<col=8A0808>~ The Observatory ~</col>", "The great eye into the heavens.")
|
||||
}
|
||||
3 -> {
|
||||
moveCamera(14, 10, 1800, 10)
|
||||
timedUpdate(3)
|
||||
}
|
||||
4 -> {
|
||||
moveCamera(6, 10, 1800, 10)
|
||||
timedUpdate(3)
|
||||
}
|
||||
5 -> {
|
||||
moveCamera(0, 32, 1800, 10)
|
||||
timedUpdate(3)
|
||||
}
|
||||
6 -> {
|
||||
moveCamera(4, 36, 1600, 10)
|
||||
timedUpdate(3)
|
||||
}
|
||||
7 -> {
|
||||
rotateCamera(7, 25, 300, 5)
|
||||
moveCamera(13, 40, 1800, 10)
|
||||
timedUpdate(3)
|
||||
}
|
||||
8 -> {
|
||||
moveCamera(12, 36, 1800, 5)
|
||||
timedUpdate(5)
|
||||
}
|
||||
9 -> {
|
||||
fadeToBlack()
|
||||
timedUpdate(5)
|
||||
}
|
||||
10 -> {
|
||||
moveCamera(5, 21, 500)
|
||||
rotateCamera(6, 27, 100)
|
||||
timedUpdate(3)
|
||||
}
|
||||
11 -> {
|
||||
fadeFromBlack()
|
||||
timedUpdate(5)
|
||||
}
|
||||
12 -> {
|
||||
playerDialogueUpdate(FacialExpression.NEUTRAL, "Hi professor!")
|
||||
}
|
||||
13 -> {
|
||||
face(getNPC(PROFESSOR)!!, player.location)
|
||||
timedUpdate(3)
|
||||
}
|
||||
14 -> {
|
||||
animate(getNPC(PROFESSOR)!!, WAVE)
|
||||
dialogueUpdate(PROFESSOR, FacialExpression.HAPPY, "Oh, hi there.")
|
||||
}
|
||||
15 -> {
|
||||
dialogueUpdate(PROFESSOR, FacialExpression.HAPPY, "I'm just adding the finishing touches.")
|
||||
}
|
||||
16 -> {
|
||||
playerDialogueUpdate(FacialExpression.HAPPY, "Okay, don't let me interrupt.")
|
||||
}
|
||||
17 -> {
|
||||
dialogueUpdate(PROFESSOR, FacialExpression.NEUTRAL, "Thank you.")
|
||||
}
|
||||
18 -> {
|
||||
face(getNPC(PROFESSOR)!!, Location(136, 25))
|
||||
dialogueUpdate(PROFESSOR, FacialExpression.NEUTRAL, "Right, let's get this finished.")
|
||||
}
|
||||
19 -> {
|
||||
animate(getNPC(PROFESSOR)!!, THINKING)
|
||||
sendChat(getNPC(PROFESSOR)!!, "Hmmmm...")
|
||||
timedUpdate(5)
|
||||
}
|
||||
20 -> {
|
||||
move(getNPC(PROFESSOR)!!, 7, 23)
|
||||
rotateCamera(9, 23, 100)
|
||||
moveCamera(12, 30, 300)
|
||||
timedUpdate(3)
|
||||
}
|
||||
21 -> {
|
||||
move(getNPC(PROFESSOR)!!, 10, 26)
|
||||
timedUpdate(10)
|
||||
}
|
||||
22 -> {
|
||||
face(getNPC(PROFESSOR)!!, Location(135, 25))
|
||||
animate(getNPC(PROFESSOR)!!, FIX)
|
||||
sendChat(getNPC(PROFESSOR)!!, "Bit of a tap here...")
|
||||
timedUpdate(3)
|
||||
}
|
||||
23 -> {
|
||||
move(getNPC(PROFESSOR)!!, 11, 26)
|
||||
timedUpdate(5)
|
||||
}
|
||||
24 -> {
|
||||
face(getNPC(PROFESSOR)!!, player.location)
|
||||
dialogueUpdate(PROFESSOR, FacialExpression.HAPPY, "@name, I'm just going upstairs to finish off.")
|
||||
}
|
||||
25 -> {
|
||||
playerDialogueUpdate(FacialExpression.HAPPY, "Right-oh.")
|
||||
}
|
||||
26 -> {
|
||||
face(getNPC(PROFESSOR)!!, Location(140, 25))
|
||||
timedUpdate(3)
|
||||
}
|
||||
27 -> {
|
||||
teleport(getNPC(PROFESSOR)!!, 11, 22, 1)
|
||||
teleport(player, 14,29,1)
|
||||
face(getNPC(PROFESSOR)!!, Location(2442, 3158, 1))
|
||||
moveCamera(6, 20, 400)
|
||||
rotateCamera(10, 24, 400)
|
||||
timedUpdate(5)
|
||||
}
|
||||
28 -> {
|
||||
move(getNPC(PROFESSOR)!!, 7, 27)
|
||||
moveCamera(10, 20, 400, 1)
|
||||
rotateCamera(7, 27, 50, 20)
|
||||
timedUpdate(10)
|
||||
}
|
||||
29 -> {
|
||||
sendChat(getNPC(PROFESSOR)!!, "In goes the lens.")
|
||||
timedUpdate(3)
|
||||
}
|
||||
30 -> {
|
||||
animate(getNPC(PROFESSOR)!!, TUNEUP)
|
||||
timedUpdate(20)
|
||||
}
|
||||
31 -> {
|
||||
sendChat(getNPC(PROFESSOR)!!, "And one final adjustment.")
|
||||
move(getNPC(PROFESSOR)!!, 10, 29)
|
||||
timedUpdate(6)
|
||||
}
|
||||
32 -> {
|
||||
move(getNPC(PROFESSOR)!!, 10, 25)
|
||||
face(getNPC(PROFESSOR)!!, Location(137, 26))
|
||||
timedUpdate(6)
|
||||
}
|
||||
33 -> {
|
||||
face(getNPC(PROFESSOR)!!, Location(137, 26))
|
||||
animate(getNPC(PROFESSOR)!!, CRANK)
|
||||
sendChat(getNPC(PROFESSOR)!!, "And all our work pays off.")
|
||||
timedUpdate(6)
|
||||
}
|
||||
34 -> {
|
||||
animate(getNPC(PROFESSOR)!!, CHEER)
|
||||
timedUpdate(10)
|
||||
}
|
||||
35 -> {
|
||||
moveCamera(6, 27, 500, 5)
|
||||
rotateCamera(10, 25, 50, 5)
|
||||
timedUpdate(3)
|
||||
}
|
||||
36 -> {
|
||||
end {
|
||||
setAttribute(player, attributeFinishedCutscene, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
val PROFESSOR = NPCs.OBSERVATORY_PROFESSOR_6121
|
||||
val WAVE = Animations.HUMAN_WAVE_863
|
||||
val THINKING = 6844
|
||||
val FIX = 6847
|
||||
val TUNEUP = 6848
|
||||
val CRANK = 6845
|
||||
val CHEER = Animations.HUMAN_CHEER_862
|
||||
}
|
||||
}
|
||||
+676
@@ -0,0 +1,676 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import content.data.Quests
|
||||
import core.api.*
|
||||
import core.game.dialogue.*
|
||||
import content.region.kandarin.quest.observatoryquest.ObservatoryQuest.Companion.attributeReceivedWine
|
||||
import core.game.interaction.QueueStrength
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Components
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class ObservatoryProfessorDialogue (player: Player? = null) : DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player): DialoguePlugin {
|
||||
return ObservatoryProfessorDialogue(player)
|
||||
}
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
openDialogue(player, ObservatoryProfessorDialogueFile(), npc)
|
||||
return false
|
||||
}
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.OBSERVATORY_ASSISTANT_6119, NPCs.OBSERVATORY_ASSISTANT_6120)
|
||||
}
|
||||
}
|
||||
|
||||
class ObservatoryProfessorDialogueFile : DialogueLabeller() {
|
||||
override fun addConversation() {
|
||||
assignToIds(NPCs.OBSERVATORY_PROFESSOR_488)
|
||||
|
||||
npc("What would you like to talk about?")
|
||||
options(
|
||||
DialogueOption("observatoryquest", "Talk about the Observatory Quest.", skipPlayer = true),
|
||||
DialogueOption("treasuretrails", "Talk about the Treasure Trails.", skipPlayer = true),
|
||||
)
|
||||
|
||||
label("observatoryquest")
|
||||
exec { player, npc ->
|
||||
loadLabel(player, "observatoryqueststage" + getQuestStage(player, Quests.OBSERVATORY_QUEST))
|
||||
}
|
||||
|
||||
label("observatoryqueststage0")
|
||||
player("Hi, I was...")
|
||||
npc(FacialExpression.FRIENDLY, "Welcome to the magnificent wonder of the Observatory, where wonder is all around you, where the stars can be clutched from the heavens!")
|
||||
player("Wow, nice intro.")
|
||||
npc(FacialExpression.FRIENDLY, "Why, thanks! How might I help you?")
|
||||
options(
|
||||
DialogueOption("totallylost", "I'm totally lost."),
|
||||
DialogueOption("whatwhat", "An Observatory?", expression = FacialExpression.THINKING),
|
||||
DialogueOption("nah", "I'm just passing through."),
|
||||
)
|
||||
|
||||
label("totallylost")
|
||||
npc(FacialExpression.THINKING, "Lost? It must have been those pesky goblins that led you astray.")
|
||||
npc("Head north-east to find the city of Ardougne.")
|
||||
player("I'm sure I'll find the way.")
|
||||
player("Thanks for all your help.")
|
||||
npc(FacialExpression.FRIENDLY, "No problem at all. Come and visit again!")
|
||||
line("The professor carries on with his studies.")
|
||||
|
||||
label("nah")
|
||||
npc("Fair enough. Not everyone is interested in this place, I suppose.")
|
||||
|
||||
label("whatwhat")
|
||||
npc(FacialExpression.FRIENDLY, "Of course. We have a superb telescope up in the Observatory, on the hill.")
|
||||
npc(FacialExpression.FRIENDLY, "A truly marvellous invention, the likes of which you'll never behold again.")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Well, it would be if it worked.")
|
||||
npc(FacialExpression.ANGRY, "Don't interrupt!")
|
||||
player(FacialExpression.THINKING, "What? It doesn't work?")
|
||||
npc("Oh, no, no, no. Don't listen to him, he's joking. Aren't you, my FAITHFUL assistant?")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Nope, dead serious. Hasn't been working for a long time.")
|
||||
npc(FacialExpression.ANGRY, "Arghhh! Get back to work and stop sticking your nose in!")
|
||||
player("So, it's broken. How come?")
|
||||
npc(FacialExpression.SAD, "Oh, I suppose there's no use keeping it secret. Did you see those houses outside?")
|
||||
player("Up on the hill? Yes, I've seen them.")
|
||||
npc("It's a horde of goblins.")
|
||||
npc(FacialExpression.SAD, "Since they moved here they have caused nothing but trouble.")
|
||||
npc("Last week, my telescope was tampered with.")
|
||||
npc(FacialExpression.ANGRY, "Now, parts need replacing before it can be used again. They've even been messing around in the dungeons under this area. Something needs to be done.")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Strikes me that this visitor could help us.")
|
||||
npc(FacialExpression.ANGRY, "Stop being so rude.")
|
||||
npc("...")
|
||||
npc("Although, he has a point. What do you say?")
|
||||
player(FacialExpression.THINKING, "What, me?")
|
||||
options(
|
||||
DialogueOption("yestoquest", "Sounds interesting. How can I help?", "Sounds interesting, what can I do for you?", FacialExpression.FRIENDLY),
|
||||
DialogueOption("notoquest", "Oh, sorry, I don't have time for that."),
|
||||
)
|
||||
|
||||
label("notoquest")
|
||||
npc("Oh dear. I really do need some help.")
|
||||
npc("If you see anyone who can help then please send them my way.")
|
||||
|
||||
label("yestoquest")
|
||||
exec { player, _ ->
|
||||
if(getQuestStage(player, Quests.OBSERVATORY_QUEST) == 0) {
|
||||
setQuestStage(player, Quests.OBSERVATORY_QUEST, 1)
|
||||
}
|
||||
}
|
||||
npc(FacialExpression.FRIENDLY, "Oh, thanks so much.")
|
||||
npc(FacialExpression.FRIENDLY, "I shall need some materials for the telescope, so it can be used again.")
|
||||
npc("Let's start with three planks of wood for the telescope base. My assistant will help with obtaining these, won't you?")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "As if I don't have enough work to do. Seems I don't have a choice.")
|
||||
npc(FacialExpression.FRIENDLY, "Go talk to him if you need some advice.")
|
||||
player(FacialExpression.FRIENDLY, "Okay, I'll be right back.")
|
||||
|
||||
label("observatoryqueststage1")
|
||||
player(FacialExpression.FRIENDLY, "Hi again!")
|
||||
npc(FacialExpression.FRIENDLY, "It's my helping hand, back again.")
|
||||
npc(FacialExpression.THINKING, "Do you have the planks yet?")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.PLANK_960, 3)) {
|
||||
loadLabel(player, "enoughplanks")
|
||||
} else {
|
||||
loadLabel(player, "notenoughplanks")
|
||||
}
|
||||
}
|
||||
|
||||
label("notenoughplanks")
|
||||
player("Sorry, not yet. Three planks was it?")
|
||||
npc("It was indeed.")
|
||||
|
||||
label("enoughplanks")
|
||||
player("Yes, I've got them. Here they are.")
|
||||
exec { player, _ ->
|
||||
if(removeItem(player, Item(Items.PLANK_960, 3))) {
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 1) {
|
||||
setQuestStage(player, Quests.OBSERVATORY_QUEST, 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
npc(FacialExpression.FRIENDLY, "Well done. This will make a big difference.")
|
||||
npc(FacialExpression.FRIENDLY, "Now, the bronze for the tube. Oh, assistant!")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Okay, okay, ask me if you need any help, @name.")
|
||||
|
||||
label("observatoryqueststage2")
|
||||
player("Hi.")
|
||||
npc("The traveller returns!")
|
||||
player("Still working hard?")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Some of us are.")
|
||||
npc(FacialExpression.ANGRY, "What did I tell you about speaking when spoken to?")
|
||||
npc(FacialExpression.THINKING, "So, @name, you have the bronze bar?")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.BRONZE_BAR_2349)) {
|
||||
loadLabel(player, "hasbronzebar")
|
||||
} else {
|
||||
loadLabel(player, "nohasbronzebar")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohasbronzebar")
|
||||
player("Not yet.")
|
||||
npc("Please bring me one, then.")
|
||||
|
||||
label("hasbronzebar")
|
||||
player(FacialExpression.FRIENDLY, "I certainly do. Here you go.")
|
||||
exec { player, _ ->
|
||||
if(removeItem(player, Item(Items.BRONZE_BAR_2349))) {
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 2) {
|
||||
setQuestStage(player, Quests.OBSERVATORY_QUEST, 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
npc(FacialExpression.FRIENDLY, "Great. Now all I need is the lens made.")
|
||||
npc(FacialExpression.FRIENDLY, "Please get me some molten glass.")
|
||||
npc("Oi! Lazy bones!")
|
||||
player(FacialExpression.AMAZED, "What? I'm not lazy.")
|
||||
npc("Not you! I'm talking to my assistant.")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Calm down old man, I heard. @name, I'm here if you need any help.")
|
||||
npc("Thank you. Wait a minute, who are you calling 'old'?")
|
||||
|
||||
label("observatoryqueststage3")
|
||||
npc("How are you getting on finding me some molten glass?")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.MOLTEN_GLASS_1775)) {
|
||||
loadLabel(player, "hasmoltenglass")
|
||||
} else {
|
||||
loadLabel(player, "nohasmoltenglass")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohasmoltenglass")
|
||||
player("Still working on it.")
|
||||
npc("I really need it. Please hurry.")
|
||||
|
||||
label("hasmoltenglass")
|
||||
player(FacialExpression.FRIENDLY, "Here it is.")
|
||||
exec { player, _ ->
|
||||
if(removeItem(player, Item(Items.MOLTEN_GLASS_1775))) {
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 3) {
|
||||
setQuestStage(player, Quests.OBSERVATORY_QUEST, 4)
|
||||
}
|
||||
}
|
||||
}
|
||||
npc(FacialExpression.FRIENDLY, "Excellent work, let's make the lens.")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "It'll need to be made to an exact shape and size.")
|
||||
npc("Well, obviously, hence why we have a lens mould.")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Not any more. One of those goblins took it.")
|
||||
npc(FacialExpression.SAD, "Great, just what I need. @name, I don't suppose you could find it?")
|
||||
player(FacialExpression.FRIENDLY, "I'll have a look - where should I start?")
|
||||
npc(FacialExpression.FRIENDLY, "No idea. You could ask my USELESS assistant if you want.")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "What have I done to deserve this?")
|
||||
|
||||
label("observatoryqueststage4")
|
||||
npc(FacialExpression.THINKING, "Did you bring me the mould?")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.LENS_MOULD_602)) {
|
||||
loadLabel(player, "haslensmould")
|
||||
} else {
|
||||
loadLabel(player, "nohaslensmould")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohaslensmould")
|
||||
player("Still looking for it.")
|
||||
npc("Please try and find it; my assistant may be able to help.")
|
||||
|
||||
label("haslensmould")
|
||||
player(FacialExpression.HAPPY, "I certainly have. You'll never guess what they were doing with it.")
|
||||
npc("Well, from the smell I'd guess cooking some vile concoction.")
|
||||
player(FacialExpression.HAPPY, "Wow, good guess. Well, here you go.")
|
||||
npc(FacialExpression.NEUTRAL, NPCs.OBSERVATORY_ASSISTANT_6118, "Please don't give that to him. Last time he tried any Crafting, I had to spend a week cleaning up after the explosion.")
|
||||
player("Explosion?")
|
||||
npc(FacialExpression.SUSPICIOUS, "Erm, yes. I think in this instance you had probably better do it.")
|
||||
player("I suppose it's better I don't ask.")
|
||||
npc(FacialExpression.HAPPY,"You can use the mould with molten glass to make a new lens.")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.LENS_MOULD_602)) {
|
||||
addItemOrDrop(player, Items.MOLTEN_GLASS_1775)
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 4) {
|
||||
setQuestStage(player, Quests.OBSERVATORY_QUEST, 5)
|
||||
}
|
||||
}
|
||||
}
|
||||
item(Item(Items.MOLTEN_GLASS_1775), "The professor gives you back the molten glass.")
|
||||
|
||||
|
||||
label("observatoryqueststage5")
|
||||
npc("Is the lens finished?")
|
||||
exec { player, _ ->
|
||||
if(inInventory(player, Items.OBSERVATORY_LENS_603)) {
|
||||
loadLabel(player, "haslens")
|
||||
} else {
|
||||
loadLabel(player, "nohaslens")
|
||||
}
|
||||
}
|
||||
|
||||
label("nohaslens")
|
||||
player("How do I make it again?")
|
||||
npc("Use the molten glass with the mould.")
|
||||
player("Huh. Simple.")
|
||||
|
||||
label("haslens")
|
||||
player("Yes, here it is. You may as well take this mould too.") //No source if no mould present
|
||||
line("The player hands the observatory professor the observatory lens.")
|
||||
npc("Wonderful, at last I can fix the telescope.")
|
||||
npc("Would you accompany me to the Observatory? You simply must see the telescope in operation.")
|
||||
player("Sounds interesting. Count me in.")
|
||||
npc("Superb. You'll have to go via the dungeon under the goblin settlement, seeing as the bridge is broken. You'll find stairs up to the Observatory from there.")
|
||||
player("Okay. See you there.")
|
||||
exec { player, _ ->
|
||||
setVarbit(player, ObservatoryQuest.telescopeVarbit, 1, true)
|
||||
queueScript(player, 0, QueueStrength.SOFT) { stage: Int ->
|
||||
when (stage) {
|
||||
0 -> {
|
||||
openOverlay(player, Components.FADE_TO_BLACK_120)
|
||||
return@queueScript delayScript(player, 4)
|
||||
}
|
||||
1 -> {
|
||||
if(removeItem(player, Item(Items.OBSERVATORY_LENS_603))) {
|
||||
removeItem(player, Item(Items.LENS_MOULD_602))
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 5) {
|
||||
setQuestStage(player, Quests.OBSERVATORY_QUEST, 6)
|
||||
}
|
||||
}
|
||||
return@queueScript delayScript(player, 1)
|
||||
}
|
||||
2 -> {
|
||||
openOverlay(player, Components.FADE_FROM_BLACK_170)
|
||||
return@queueScript delayScript(player, 2)
|
||||
}
|
||||
3 -> {
|
||||
sendDialogueLines(player, "The professor has gone ahead to the Observatory dome. Best you", "follow him to see the finished telescope.")
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
else -> return@queueScript stopExecuting(player)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
label("observatoryqueststage6")
|
||||
npc("Hello, friend.")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) != null) {
|
||||
loadLabel(player, "hasviewtelescope")
|
||||
} else {
|
||||
loadLabel(player, "nohasviewtelescope")
|
||||
}
|
||||
}
|
||||
label("nohasviewtelescope")
|
||||
// http://youtu.be/cK5suqcw3qU
|
||||
player("Hi, this really is impressive.")
|
||||
npc("Certainly is. Please, take a look through the telescope and tell me what you see.")
|
||||
|
||||
label("hasviewtelescope")
|
||||
player("I've had a look through the telescope.")
|
||||
npc("What did you see? If you're not sure, you can find out by looking at the star charts dotted around the walls downstairs.")
|
||||
player("It was...")
|
||||
goto("page1")
|
||||
|
||||
|
||||
label("page1")
|
||||
options(
|
||||
DialogueOption("Aquarius", "Aquarius", skipPlayer = true),
|
||||
DialogueOption("Capricorn", "Capricorn", skipPlayer = true),
|
||||
DialogueOption("Sagittarius", "Sagittarius", skipPlayer = true),
|
||||
DialogueOption("Scorpio", "Scorpio", skipPlayer = true),
|
||||
DialogueOption("page2", "~ next ~", skipPlayer = true),
|
||||
)
|
||||
|
||||
label("page2")
|
||||
options(
|
||||
DialogueOption("page1", "~ previous ~", skipPlayer = true),
|
||||
DialogueOption("Libra", "Libra", skipPlayer = true),
|
||||
DialogueOption("Virgo", "Virgo", skipPlayer = true),
|
||||
DialogueOption("Leo", "Leo", skipPlayer = true),
|
||||
DialogueOption("page3", "~ next ~", skipPlayer = true),
|
||||
)
|
||||
|
||||
label("page3")
|
||||
options(
|
||||
DialogueOption("page2", "~ previous ~", skipPlayer = true),
|
||||
DialogueOption("Cancer", "Cancer", skipPlayer = true),
|
||||
DialogueOption("Gemini", "Gemini", skipPlayer = true),
|
||||
DialogueOption("Taurus", "Taurus", skipPlayer = true),
|
||||
DialogueOption("page4", "~ next ~", skipPlayer = true),
|
||||
)
|
||||
|
||||
label("page4")
|
||||
options(
|
||||
DialogueOption("page3", "~ previous ~", skipPlayer = true),
|
||||
DialogueOption("Aries", "Aries", skipPlayer = true),
|
||||
DialogueOption("Pisces", "Pisces", skipPlayer = true),
|
||||
)
|
||||
|
||||
label("Aquarius")
|
||||
player("Aquarius!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 19) {
|
||||
loadLabel(player, "Aquariuscorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Aquariuscorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Aquarius, the water-bearer.")
|
||||
npc("It seems suitable, then, to award you with water runes!")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.WATER_RUNE_555, 25)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Aries")
|
||||
player("Aries!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 20) {
|
||||
loadLabel(player, "Ariescorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Ariescorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Aries, the ram.")
|
||||
npc("A fierce fighter. I'm sure he'll look down on you and improve your Attack for such insight.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
rewardXP(player, Skills.ATTACK, 875.0)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Cancer")
|
||||
player("Cancer!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 21) {
|
||||
loadLabel(player, "Cancercorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Cancercorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Cancer, the crab.")
|
||||
npc("An armoured creature - I think I shall reward you with an amulet of protection.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.AMULET_OF_DEFENCE_1729)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Capricorn")
|
||||
player("Capricorn!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 22) {
|
||||
loadLabel(player, "Capricorncorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Capricorncorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Capricorn, the goat.")
|
||||
npc("Capricorn will surely reward your insight with an increase to your Strength.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
rewardXP(player, Skills.STRENGTH, 875.0)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Gemini")
|
||||
player("Gemini!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 23) {
|
||||
loadLabel(player, "Geminicorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Geminicorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Gemini, the twins.")
|
||||
npc("With the double nature of Gemini, I can't offer you anything more suitable than a two-handed weapon.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.BLACK_2H_SWORD_1313)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Leo")
|
||||
player("Leo!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 24) {
|
||||
loadLabel(player, "Leocorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Leocorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Leo, the lion.")
|
||||
npc("I think the majestic power of the lion will raise your Hitpoints.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
rewardXP(player, Skills.HITPOINTS, 875.0)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Libra")
|
||||
player("Libra!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 25) {
|
||||
loadLabel(player, "Libracorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Libracorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Libra, the scales.")
|
||||
npc("Hmmm, balance, law, order - I shall award you with law runes!")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.LAW_RUNE_563, 25)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Pisces")
|
||||
player("Pisces!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 26) {
|
||||
loadLabel(player, "Piscescorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Piscescorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Pisces, the fish.")
|
||||
npc("What's more suitable as a reward than some tuna?")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.TUNA_361, 3)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Sagittarius")
|
||||
player("Sagittarius!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 27) {
|
||||
loadLabel(player, "Sagittariuscorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Sagittariuscorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Sagittarius, the centaur.")
|
||||
npc("As you've spotted the archer, I shall reward you with a maple longbow.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.MAPLE_LONGBOW_851)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Scorpio")
|
||||
player("Scorpio!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 28) {
|
||||
loadLabel(player, "Scorpiocorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Scorpiocorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Scorpio, the scorpion.")
|
||||
npc("I think weapon poison would make a suitable reward.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.WEAPON_POISON_187)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Taurus")
|
||||
player("Taurus!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 29) {
|
||||
loadLabel(player, "Tauruscorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Tauruscorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Taurus, the bull.")
|
||||
npc("This Strength potion should be a suitable reward.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.SUPER_STRENGTH1_161)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("Virgo")
|
||||
player("Virgo!")
|
||||
exec { player, _ ->
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == 30) {
|
||||
loadLabel(player, "Virgocorrect")
|
||||
} else {
|
||||
loadLabel(player, "wrongstar")
|
||||
}
|
||||
}
|
||||
|
||||
label("Virgocorrect")
|
||||
npc("That's exactly it!")
|
||||
player("Yes! Woo hoo!")
|
||||
npc("That's Virgo, the virtuous.")
|
||||
npc("Virgo will surely provide you with an increase to Defence.")
|
||||
// Usually it is given here, but I don't want loopholes.
|
||||
npc("By Saradomin's earlobes! You must be a friend of the gods indeed.")
|
||||
npc("Look in your backpack for your reward, in payment for your work.")
|
||||
exec { player, _ ->
|
||||
rewardXP(player, Skills.DEFENCE, 875.0)
|
||||
addItemOrDrop(player, Items.UNCUT_SAPPHIRE_1623)
|
||||
finishQuest(player, Quests.OBSERVATORY_QUEST)
|
||||
}
|
||||
|
||||
label("wrongstar")
|
||||
npc("I'm afraid not. Have another look. Remember, you can check the star charts on the walls for reference.")
|
||||
|
||||
// http://youtu.be/Z5RRnZl2vTg
|
||||
label("observatoryqueststage100")
|
||||
npc("Thanks for all your help with the telescope. What can I do for you?")
|
||||
options(
|
||||
DialogueOption("needmorehelp", "Do you need any more help with the telescope?", expression = FacialExpression.ASKING),
|
||||
DialogueOption("mambodunaroona", "Is it true your name is Mambo-duna-roona?", expression = FacialExpression.ASKING) { player, _ ->
|
||||
return@DialogueOption getAttribute(player, attributeReceivedWine, false)
|
||||
},
|
||||
DialogueOption("nevermind", "Nothing, thanks."),
|
||||
)
|
||||
|
||||
label("needmorehelp")
|
||||
npc("Not right now,")
|
||||
npc("but the stars may hold a secret for you.")
|
||||
|
||||
label("nevermind")
|
||||
npc("Okay, no problem. See you again.")
|
||||
|
||||
label("treasuretrails")
|
||||
npc("Welcome back! How can I help you today?")
|
||||
player("Can you teach me to solve treasure trail clues?")
|
||||
npc("Ah, I get asked about treasure trails all the time! Listen carefully and I shall tell you what I know...")
|
||||
npc("Lots of clues have <col=8A0808>degrees</col> and <col=8A0808>minutes</col> written on them. These are the coordinates of the place where the treasure is buried.")
|
||||
npc("You have to walk to the correct spot, so that your coordinates are exactly the same as the values written on the clue scroll.")
|
||||
npc("To do this, you must use a <col=8A0808>sextant</col>, a <col=8A0808>watch</col> and a <col=8A0808>chart</col> to find your own coordinates.")
|
||||
npc("Once you know the coordinates of the place where you are, you know which way you have to walk to get to the place where the treasure is!")
|
||||
player("Riiight. So where do I get those items from?")
|
||||
npc("I think Murphy, the owner of the fishing trawler moored south of Ardougne, might be able to spare you a sextant. Then the nearest Clock Tower is south of Ardougne - you could probably get a watch there. I've")
|
||||
npc("got plenty of charts myself, here have one.")
|
||||
|
||||
label("mambodunaroona")
|
||||
npc(FacialExpression.AMAZED, "How do you know tha-")
|
||||
npc(FacialExpression.SUSPICIOUS, "I mean, of course not, what a silly idea.")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import content.data.Quests
|
||||
import core.api.*
|
||||
import core.api.setVarp
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.quest.Quest
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
|
||||
// http://youtu.be/TWIkCRRea8A The initial quest log.
|
||||
// http://youtu.be/onHNm9Z5L-o The best full quest log.
|
||||
// http://youtu.be/cq-jGTXXHuE
|
||||
// http://youtu.be/ekYr30h43ag Scorpius.
|
||||
/**
|
||||
* Observatory Quest
|
||||
*/
|
||||
@Initializable
|
||||
class ObservatoryQuest : Quest(Quests.OBSERVATORY_QUEST, 96, 95, 2,112, 0, 1, 7) {
|
||||
|
||||
companion object {
|
||||
val questName = Quests.OBSERVATORY_QUEST
|
||||
const val observatoryVarp = 112
|
||||
const val goblinStoveVarbit = 3837
|
||||
const val telescopeVarbit = 3838
|
||||
|
||||
const val starChartsInterface = 104
|
||||
const val telescopeInterface = 552
|
||||
const val dungeonWarning = 560
|
||||
|
||||
const val attributeKilledGuard = "/save:quest:observatoryquest-killedguard"
|
||||
const val attributeUnlockedGate = "/save:quest:observatoryquest-unlockedgate"
|
||||
const val attributeTelescopeStar = "/save:quest:observatoryquest-telescopestar" // NULL - not seen telescope, 19 - 30 one of the random star patterns
|
||||
const val attributeReceivedWine = "/save:quest:observatoryquest-receivedwine"
|
||||
const val attributeReceivedMould = "/save:quest:observatoryquest-receivedmould"
|
||||
const val attributeRandomChest = "/save:quest:observatoryquest-randomchest"
|
||||
const val attributeFinishedCutscene = "/save:quest:observatoryquest-finishedcutscene"
|
||||
|
||||
}
|
||||
override fun drawJournal(player: Player, stage: Int) {
|
||||
super.drawJournal(player, stage)
|
||||
var line = 12
|
||||
var stage = getStage(player)
|
||||
|
||||
var started = getQuestStage(player, questName) > 0
|
||||
|
||||
if (!started) {
|
||||
line(player, "I can start this quest by speaking to the !!professor?? in the", line++, false)
|
||||
line(player, "!!Observatory reception, south-west of Ardougne.??", line++, false)
|
||||
} else {
|
||||
line(player, "I can start this quest by speaking to the professor in the", line++, true)
|
||||
line(player, "Observatory reception, south-west of Ardougne.", line++, true)
|
||||
|
||||
if (stage >= 5) {
|
||||
line(player, "I should take the letter the Examiner has given me to the", line++, true)
|
||||
line(player, "Curator of Varrock Museum, for his approval.", line++, true)
|
||||
line++
|
||||
} else if (stage >= 1) {
|
||||
line(player, "Seems the observatory telescope needs repairing, due to", line++)
|
||||
line(player, "the nearby goblins. The !!professor?? wants me to help by", line++)
|
||||
line(player, "getting the following, with the help of his !!assistant??:", line++)
|
||||
line++
|
||||
}
|
||||
if (stage >= 2) {
|
||||
line(player, "!!3 plain wooden planks??", line++, true)
|
||||
} else if (stage >= 1) {
|
||||
line(player, "!!3 plain wooden planks??", line++, inInventory(player, Items.PLANK_960, 3))
|
||||
}
|
||||
if (stage >= 3) {
|
||||
line(player, "!!1 bronze bar??", line++, true)
|
||||
} else if (stage >= 2) {
|
||||
line(player, "!!1 bronze bar??", line++, inInventory(player, Items.BRONZE_BAR_2349))
|
||||
}
|
||||
if (stage >= 4) {
|
||||
line(player, "!!1 molten glass??", line++, true)
|
||||
} else if (stage >= 3) {
|
||||
line(player, "!!1 molten glass??", line++, inInventory(player, Items.MOLTEN_GLASS_1775))
|
||||
}
|
||||
if (stage >= 5) {
|
||||
line(player, "!!1 lens mould??", line++, true)
|
||||
} else if (stage >= 4) {
|
||||
line(player, "!!1 lens mould??", line++)
|
||||
}
|
||||
|
||||
if (stage >= 6) {
|
||||
line(player, "The professor was pleased to have all the pieces needed", line++, true)
|
||||
line(player, "to fix the telescope. Apparently, the professor's last", line++, true)
|
||||
line(player, "attempt at Crafting ended in disaster. So, he wants me to", line++, true)
|
||||
line(player, "create the lens by using the molten glass with the mould.", line++, true)
|
||||
line(player, "Fine by me!", line++, true)
|
||||
} else if (stage >= 5) {
|
||||
line(player, "The !!professor?? was pleased to have all the pieces needed", line++)
|
||||
line(player, "to fix the telescope. Apparently, the professor's last", line++)
|
||||
line(player, "attempt at Crafting ended in disaster. So, he wants me to", line++)
|
||||
line(player, "create the !!lens?? by using the !!molten glass?? with the !!mould??.", line++)
|
||||
line(player, "Fine by me!", line++)
|
||||
}
|
||||
|
||||
if (stage >= 100) {
|
||||
line(player, "The professor has gone ahead to the Observatory. He", line++, true)
|
||||
line(player, "wants me to meet him there by travelling through the", line++, true)
|
||||
line(player, "dungeon below it.", line++, true)
|
||||
} else if (stage >= 6) {
|
||||
line(player, "The !!professor?? has gone ahead to the !!Observatory??. He", line++)
|
||||
line(player, "wants me to meet him there by travelling through the", line++)
|
||||
line(player, "!!dungeon?? below it.", line++)
|
||||
}
|
||||
if (stage >= 100) {
|
||||
line++
|
||||
line(player,"<col=FF0000>QUEST COMPLETE!</col>", line)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun finish(player: Player) {
|
||||
var ln = 10
|
||||
super.finish(player)
|
||||
player.packetDispatch.sendString("You have completed the Observatory Quest!", 277, 4)
|
||||
// This image is special since it isn't an item, but a standalone model.
|
||||
player.packetDispatch.sendModelOnInterface(1174, 277, 5, 0) // Scenery 2210, Model 1174
|
||||
player.packetDispatch.sendAngleOnInterface(277, 5, 2040, 0, 1836)
|
||||
|
||||
drawReward(player, "2 Quest Points", ln++)
|
||||
drawReward(player, "2,250 Crafting XP", ln++)
|
||||
drawReward(player, "A payment depending on", ln++)
|
||||
drawReward(player, "which constellation you", ln++)
|
||||
drawReward(player, "observed", ln++)
|
||||
|
||||
rewardXP(player, Skills.CRAFTING, 2250.0)
|
||||
}
|
||||
|
||||
override fun updateVarps(player: Player) {
|
||||
setVarp(player, observatoryVarp, getQuestStage(player, questName), true)
|
||||
if(getQuestStage(player, questName) >= 6) {
|
||||
setVarbit(player, telescopeVarbit, 1, true)
|
||||
} else {
|
||||
setVarbit(player, telescopeVarbit, 0, true)
|
||||
}
|
||||
if(getQuestStage(player, questName) >= 7) {
|
||||
setVarp(player, observatoryVarp, 7, true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun reset(player : Player) {
|
||||
removeAttribute(player, attributeKilledGuard)
|
||||
removeAttribute(player, attributeUnlockedGate)
|
||||
removeAttribute(player, attributeTelescopeStar)
|
||||
removeAttribute(player, attributeReceivedWine)
|
||||
removeAttribute(player, attributeReceivedMould)
|
||||
removeAttribute(player, attributeRandomChest)
|
||||
removeAttribute(player, attributeFinishedCutscene)
|
||||
setVarbit(player, 3837, 0, true)
|
||||
}
|
||||
|
||||
override fun newInstance(`object`: Any?): Quest {
|
||||
return this
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import core.api.*
|
||||
import core.game.interaction.InterfaceListener
|
||||
import core.game.world.map.Location
|
||||
|
||||
class ObservatoryQuestInterfaces : InterfaceListener {
|
||||
|
||||
companion object {
|
||||
|
||||
val buttonToNameMapping = mapOf(
|
||||
19 to "Aquarius",
|
||||
20 to "Aries",
|
||||
21 to "Cancer",
|
||||
22 to "Capricorn",
|
||||
23 to "Gemini",
|
||||
24 to "Leo",
|
||||
25 to "Libra",
|
||||
26 to "Pisces",
|
||||
27 to "Sagittarius",
|
||||
28 to "Scorpio",
|
||||
29 to "Taurus",
|
||||
30 to "Virgo",
|
||||
)
|
||||
|
||||
val buttonToStarObjectMapping = mapOf(
|
||||
19 to 27064,
|
||||
20 to 27066,
|
||||
21 to 27067,
|
||||
22 to 27061,
|
||||
23 to 27068,
|
||||
24 to 27058,
|
||||
25 to 27057,
|
||||
26 to 27062,
|
||||
27 to 27056,
|
||||
28 to 27055,
|
||||
29 to 27059,
|
||||
30 to 27060,
|
||||
)
|
||||
}
|
||||
|
||||
override fun defineInterfaceListeners() {
|
||||
on(ObservatoryQuest.starChartsInterface) { player, component, opcode, buttonID, slot, itemID ->
|
||||
if(buttonToStarObjectMapping.contains(buttonID)){
|
||||
// 55 57
|
||||
player.packetDispatch.sendModelOnInterface(buttonToStarObjectMapping[buttonID]!!, ObservatoryQuest.starChartsInterface, 55, 0)
|
||||
setInterfaceText(player, buttonToNameMapping[buttonID]!!, ObservatoryQuest.starChartsInterface, 57)
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
on(ObservatoryQuest.dungeonWarning) { player, _, _, buttonID, _, _ ->
|
||||
when (buttonID) {
|
||||
17 -> teleport(player, Location(2355, 9394)).also { closeInterface(player) }
|
||||
18 -> closeInterface(player)
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
+294
@@ -0,0 +1,294 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import content.data.Quests
|
||||
import content.region.kandarin.quest.observatoryquest.ObservatoryQuest.Companion.attributeFinishedCutscene
|
||||
import content.region.kandarin.quest.observatoryquest.ObservatoryQuest.Companion.attributeRandomChest
|
||||
import core.ServerConstants
|
||||
import core.api.*
|
||||
import core.game.dialogue.DialogueFile
|
||||
import core.game.dialogue.FacialExpression
|
||||
import core.game.global.action.DoorActionHandler
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.interaction.QueueStrength
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.world.map.Location
|
||||
import core.tools.END_DIALOGUE
|
||||
import core.tools.RandomFunction
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
import org.rs09.consts.Scenery
|
||||
|
||||
class ObservatoryQuestListeners : InteractionListener {
|
||||
|
||||
companion object {
|
||||
val chestMap = mapOf(
|
||||
Scenery.CHEST_2191 to Scenery.CHEST_2194,
|
||||
Scenery.CHEST_25385 to Scenery.CHEST_25386,
|
||||
Scenery.CHEST_25387 to Scenery.CHEST_25388,
|
||||
Scenery.CHEST_25389 to Scenery.CHEST_25390,
|
||||
Scenery.CHEST_25391 to Scenery.CHEST_25392
|
||||
)
|
||||
|
||||
val reverseChestMap = chestMap.map { (k, v) -> v to k }.toMap()
|
||||
|
||||
/* Comments show only the default order BEFORE randomization. A randomized
|
||||
number (0-10) is calculated the first time the player goes down the stairs,
|
||||
and is then added to the map value modulo 11, rotating the map.
|
||||
*/
|
||||
|
||||
val chestLocations = mapOf(
|
||||
Location(2333, 9405) to 0, // key
|
||||
Location(2312, 9400) to 1, // spider
|
||||
Location(2310, 9374) to 2, // spider
|
||||
Location(2348, 9383) to 3, // empty
|
||||
Location(2356, 9380) to 4, // spider
|
||||
Location(2359, 9376) to 5, // empty
|
||||
Location(2360, 9366) to 6, // empty
|
||||
Location(2351, 9361) to 7, // spider
|
||||
Location(2364, 9355) to 8, // antipoison
|
||||
Location(2335, 9374) to 9, // spider
|
||||
Location(2326, 9360) to 10) // empty
|
||||
}
|
||||
|
||||
override fun defineListeners() {
|
||||
|
||||
on(Scenery.SIGNPOST_25397, SCENERY, "read") { player, _ ->
|
||||
openDialogue(player, object : DialogueFile(){
|
||||
override fun handle(componentID: Int, buttonID: Int) {
|
||||
val servername = ServerConstants.SERVER_NAME
|
||||
when(stage){
|
||||
0 -> sendDialogueLines(player, "~ The Observatory ~", "Step ahead to the reception if you wish to explore $servername's most", "magnificent invention.").also {
|
||||
stage++
|
||||
}
|
||||
1 -> player(FacialExpression.NEUTRAL, "Magnificent invention? I've seen some pretty magnificent", "things in my time. It'll have to be pretty impressive.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
}
|
||||
})
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.ORRERY_25401, SCENERY, "view") { player, _ ->
|
||||
sendChat(player, "Oooooh, bizarre!")
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.STAIRS_25432, SCENERY, "climb-down") { player, _ ->
|
||||
openInterface(player, 560)
|
||||
if (getAttribute(player, attributeRandomChest, null) == null) {
|
||||
setAttribute(player, attributeRandomChest, RandomFunction.random(11))
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
// http://youtu.be/Kg84MYXgo-M -> You can always go to the observatory, no matter which stage.
|
||||
on(Scenery.STAIRS_25429, SCENERY, "climb up") { player, node ->
|
||||
if (node.location == Location(2335, 9351)) {
|
||||
if (!getAttribute(player, attributeFinishedCutscene, false) && getQuestStage(player, Quests.OBSERVATORY_QUEST) == 6) {
|
||||
ObservatoryCutscene(player).start()
|
||||
}
|
||||
else teleport(player, Location(2439, 3164))
|
||||
} else {
|
||||
teleport(player, Location(2457, 3186))
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.STAIRS_25434, SCENERY, "climb-down") { player, _ ->
|
||||
teleport(player, Location(2335, 9350))
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.STAIRS_25431, SCENERY, "climb-up") { player, _ ->
|
||||
teleport(player, Location(2443, 3160, 1))
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.STAIRS_25437, SCENERY, "climb-down") { player, _ ->
|
||||
teleport(player, Location(2444, 3162, 0))
|
||||
return@on true
|
||||
}
|
||||
|
||||
// All chests
|
||||
on(chestMap.keys.toIntArray(), SCENERY, "open") { player, node ->
|
||||
animate(player, 536)
|
||||
sendMessage(player, "You open the chest.")
|
||||
chestMap[node.id]?.let { replaceScenery(node as core.game.node.scenery.Scenery, it, 240) }
|
||||
return@on true
|
||||
}
|
||||
on(chestMap.values.toIntArray(), SCENERY, "close") { player, node ->
|
||||
animate(player, 535)
|
||||
reverseChestMap[node.id]?.let { replaceScenery(node as core.game.node.scenery.Scenery, it, -1) }
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(chestMap.values.toIntArray(), SCENERY, "search") { player, node ->
|
||||
val chest = chestLocations[node.location]?.plus(getAttribute(player, attributeRandomChest, 0))?.mod(11)
|
||||
when (chest) {
|
||||
0 -> {
|
||||
if (inInventory(player, Items.GOBLIN_KITCHEN_KEY_601) || getQuestStage(player, Quests.OBSERVATORY_QUEST) != 4 || getAttribute(player, ObservatoryQuest.attributeUnlockedGate, false)) {
|
||||
sendMessage(player, "You search the chest.")
|
||||
sendMessage(player, "The chest is empty.")
|
||||
} else {
|
||||
lock(player,2)
|
||||
queueScript(player, 2, QueueStrength.STRONG) {
|
||||
if (inInventory(player, Items.GOBLIN_KITCHEN_KEY_601)) {
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
addItemOrDrop(player, Items.GOBLIN_KITCHEN_KEY_601)
|
||||
sendItemDialogue(player, Items.GOBLIN_KITCHEN_KEY_601,"You find a kitchen key.")
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
}
|
||||
animate(player, 537)
|
||||
return@on true
|
||||
}
|
||||
1, 2, 4, 7, 9 -> {
|
||||
sendMessage(player, "You search the chest.")
|
||||
if (findLocalNPC(player, NPCs.POISON_SPIDER_1009) != null) {
|
||||
sendMessage(player, "The chest is empty.")
|
||||
animate(player, 537)
|
||||
return@on true
|
||||
}
|
||||
sendMessage(player, "The chest contains a poisonous spider.")
|
||||
val npc = NPC(NPCs.POISON_SPIDER_1009)
|
||||
npc.location = player.location
|
||||
npc.init()
|
||||
npc.isRespawn = false
|
||||
npc.moveStep()
|
||||
npc.face(player)
|
||||
animate(player, 537)
|
||||
return@on true
|
||||
}
|
||||
8 -> {
|
||||
sendMessage(player, "You search the chest.")
|
||||
lock(player,2)
|
||||
queueScript(player, 2, QueueStrength.STRONG) {
|
||||
addItemOrDrop(player, Items.ANTIPOISON1_179)
|
||||
sendMessage(player,"This chest contains some antipoison.")
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
animate(player, 537)
|
||||
return@on true
|
||||
}
|
||||
else -> {
|
||||
sendMessage(player, "You search the chest.")
|
||||
sendMessage(player, "The chest is empty.")
|
||||
animate(player, 537)
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
on(intArrayOf(Scenery.KITCHEN_GATE_2199, Scenery.KITCHEN_GATE_2200), SCENERY, "open") { player, node ->
|
||||
if (getAttribute(player, ObservatoryQuest.attributeUnlockedGate, false)) {
|
||||
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
|
||||
} else if (getAttribute(player, ObservatoryQuest.attributeKilledGuard, false)) {
|
||||
if (removeItem(player, Items.GOBLIN_KITCHEN_KEY_601)) {
|
||||
sendMessage(player, "The gate unlocks.")
|
||||
sendMessage(player, "The key is useless now. You discard it.")
|
||||
setAttribute(player, ObservatoryQuest.attributeUnlockedGate, true)
|
||||
sendPlayerDialogue(player, "I had better be quick, there may be more guards about.")
|
||||
DoorActionHandler.handleAutowalkDoor(player, node.asScenery())
|
||||
} else {
|
||||
// http://youtu.be/ZkUF-0eonls
|
||||
sendMessage(player, "The gate is locked.")
|
||||
}
|
||||
} else if (getQuestStage(player, Quests.OBSERVATORY_QUEST) >= 4){
|
||||
sendMessage(player, "If you open the gate, the guard will hear you. You need to get rid of him.")
|
||||
} else sendMessage(player, "The gate is locked.")
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(NPCs.SLEEPING_GUARD_6122, NPC, "prod") { player, node ->
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) < 4) {
|
||||
return@on true
|
||||
}
|
||||
sendChat(node as NPC, "Oi, how dare you wake me up!")
|
||||
transformNpc(node, NPCs.GOBLIN_GUARD_489, 400)
|
||||
node.attack(player)
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.GOBLIN_STOVE_25440, SCENERY, "inspect") { player, _ ->
|
||||
openDialogue(player, object : DialogueFile(){
|
||||
override fun handle(componentID: Int, buttonID: Int) {
|
||||
when(stage){
|
||||
0 -> sendDialogueLines(player, "The goblins appear to have been using the lens mould to cook their", "stew!").also { stage++ }
|
||||
1 -> sendDialogueLines(player, "You shake out its contents and take it with you.").also { animate(player, 537); stage++ }
|
||||
2 -> end().also {
|
||||
sendChat(player, "Euuuw, that smells awful!")
|
||||
setVarbit(player, ObservatoryQuest.goblinStoveVarbit ,1)
|
||||
addItemOrDrop(player, Items.LENS_MOULD_602)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.GOBLIN_STOVE_25441, SCENERY, "inspect") { player, _ ->
|
||||
if (!inInventory(player, Items.LENS_MOULD_602)) addItemOrDrop(player, Items.LENS_MOULD_602)
|
||||
return@on true
|
||||
}
|
||||
|
||||
onUseWith(ITEM, Items.LENS_MOULD_602, Items.MOLTEN_GLASS_1775) { player, _, with ->
|
||||
if (getStatLevel(player, Skills.CRAFTING) < 10) {
|
||||
sendMessage(player, "You need a crafting level of 10 to do this.")
|
||||
return@onUseWith true
|
||||
}
|
||||
|
||||
sendMessage(player, "You pour the molten glass into the mould.")
|
||||
sendMessage(player, "You clasp it together.")
|
||||
sendItemDialogue(player, Items.OBSERVATORY_LENS_603, "It has produced a small, convex glass disc.")
|
||||
if (removeItem(player, with)) {
|
||||
addItemOrDrop(player, Items.OBSERVATORY_LENS_603)
|
||||
}
|
||||
return@onUseWith true
|
||||
}
|
||||
|
||||
on(intArrayOf(Scenery.STAR_CHART_25578, Scenery.STAR_CHART_25579, Scenery.STAR_CHART_25580, Scenery.STAR_CHART_25581, Scenery.STAR_CHART_25582, Scenery.STAR_CHART_25583), SCENERY, "look-at") { player, _ ->
|
||||
openInterface(player, ObservatoryQuest.starChartsInterface)
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(intArrayOf(Scenery.TELESCOPE_25438, Scenery.TELESCOPE_25439), SCENERY, "view") { player, _ ->
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) >= 100) {
|
||||
openDialogue(player, TelescopeDialogue(), NPC(NPCs.OBSERVATORY_PROFESSOR_488))
|
||||
}
|
||||
else if (getQuestStage(player, Quests.OBSERVATORY_QUEST) >= 6) {
|
||||
if (getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null) == null) {
|
||||
setAttribute(player, ObservatoryQuest.attributeTelescopeStar, (19..30).random())
|
||||
}
|
||||
val randomStar = getAttribute<Int?>(player, ObservatoryQuest.attributeTelescopeStar, null)
|
||||
openInterface(player, ObservatoryQuest.telescopeInterface)
|
||||
player.packetDispatch.sendModelOnInterface(ObservatoryQuestInterfaces.buttonToStarObjectMapping[randomStar]!!, ObservatoryQuest.telescopeInterface, 7, 0)
|
||||
} else {
|
||||
sendMessage(player, "The telescope is broken.")
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(intArrayOf(Scenery.DOOR_25526, Scenery.DOOR_25527), SCENERY, "open") { player, _ ->
|
||||
sendMessage(player, "The door is locked.")
|
||||
return@on true
|
||||
}
|
||||
|
||||
on(Scenery.GRAVE_OF_SCORPIUS_2211, SCENERY, "read") { player, _ ->
|
||||
sendMessage(player, "Here lies Scorpius: Only those who have seen beyond the stars may seek his counsel.")
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class TelescopeDialogue : DialogueFile() {
|
||||
override fun handle(componentID: Int, buttonID: Int) {
|
||||
when(stage){
|
||||
0 -> npcl(FacialExpression.ASKING, "What do you see now?").also { stage++ }
|
||||
1 -> playerl("I can see a constellation through the telescope. It looks like Scorpio.").also { stage++ }
|
||||
2 -> npcl("Scorpio? Interesting. How very fitting.").also { stage++ }
|
||||
3 -> playerl(FacialExpression.ASKING, " What do you mean?").also { stage++ }
|
||||
4 -> npcl("Scorpius, the founder of all we know relating to astronomy. There's a book about him in the reception. Perhaps you should check it out, you might learn something.").also { stage++ }
|
||||
5 -> playerl("Then perhaps I shall.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import core.api.getAttribute
|
||||
import core.api.setAttribute
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.npc.NPCBehavior
|
||||
import core.game.world.GameWorld
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
class PoisonSpiderBehavior : NPCBehavior(NPCs.POISON_SPIDER_1009) {
|
||||
override fun onCreation(self: NPC) {
|
||||
setAttribute(self, "despawn-time", GameWorld.ticks + 100)
|
||||
}
|
||||
|
||||
override fun tick(self: NPC): Boolean {
|
||||
if (getAttribute(self, "despawn-time", 0) <= GameWorld.ticks && !self.inCombat())
|
||||
self.clear()
|
||||
return true
|
||||
}
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package content.region.kandarin.quest.observatoryquest
|
||||
|
||||
import content.data.Quests
|
||||
import content.region.kandarin.quest.observatoryquest.ObservatoryQuest.Companion.attributeReceivedMould
|
||||
import core.api.*
|
||||
import core.game.dialogue.*
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class SpiritOfScorpiusDialogue (player: Player? = null) : DialoguePlugin(player) {
|
||||
override fun newInstance(player: Player): DialoguePlugin {
|
||||
return SpiritOfScorpiusDialogue(player)
|
||||
}
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
openDialogue(player, SpiritOfScorpiusDialogueFile(), npc)
|
||||
return false
|
||||
}
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.SPIRIT_OF_SCORPIUS_492)
|
||||
}
|
||||
}
|
||||
|
||||
class SpiritOfScorpiusDialogueFile : DialogueLabeller() {
|
||||
override fun addConversation() {
|
||||
assignToIds(NPCs.SPIRIT_OF_SCORPIUS_492)
|
||||
|
||||
exec { player, npc ->
|
||||
if (getQuestStage(player, Quests.OBSERVATORY_QUEST) == 100) {
|
||||
if (!inEquipment(player, Items.GHOSTSPEAK_AMULET_552)) loadLabel(player, "noghostspeak")
|
||||
else loadLabel(player, "observatoryqueststage100")
|
||||
} else loadLabel(player, "observatoryquestincomplete")
|
||||
}
|
||||
|
||||
label("observatoryquestincomplete")
|
||||
line("They seem to be ignoring you.")
|
||||
|
||||
label("noghostspeak")
|
||||
line("This powerful spirit seems capable of speaking to you", "even though you are not wearing an Amulet of Ghostspeak.")
|
||||
exec { player, _ ->
|
||||
loadLabel(player, "observatoryqueststage100")
|
||||
}
|
||||
|
||||
label("observatoryqueststage100")
|
||||
npc("Who treads upon my grave?")
|
||||
options(
|
||||
DialogueOption("wisdom", "I seek your wisdom.") { player, _ ->
|
||||
return@DialogueOption !getAttribute(player, attributeReceivedMould, false)
|
||||
},
|
||||
DialogueOption("anothermould", "I need another unholy symbol mould.", "I need another mould for the unholy symbol.") { player, _ ->
|
||||
return@DialogueOption getAttribute(player, attributeReceivedMould, false)
|
||||
},
|
||||
DialogueOption("blessing", "I have come to seek your blessing."),
|
||||
DialogueOption("killyou", "I have come to kill you.")
|
||||
)
|
||||
|
||||
label("wisdom")
|
||||
npc("Indeed, I feel you have beheld the far places in the heavens. My Lord instructs me to help you.")
|
||||
item(Item(Items.UNHOLY_MOULD_1594), "An unholy mould appears in your inventory.")
|
||||
exec { player, _ ->
|
||||
addItemOrDrop(player, Items.UNHOLY_MOULD_1594)
|
||||
setAttribute(player, attributeReceivedMould, true)
|
||||
}
|
||||
npc("Here is a mould to make a token for our Lord; a mould for the unholy symbol of Zamorak. Return to me when you desire my blessing.")
|
||||
|
||||
label("anothermould")
|
||||
exec { player, _ ->
|
||||
if (inInventory(player, Items.UNHOLY_MOULD_1594)) {
|
||||
loadLabel(player, "hasmould")
|
||||
}
|
||||
else {
|
||||
addItemOrDrop(player, Items.UNHOLY_MOULD_1594)
|
||||
loadLabel(player, "lostmould")
|
||||
}
|
||||
}
|
||||
|
||||
label("hasmould")
|
||||
npc("One you already have, another is not needed. Leave me be.")
|
||||
|
||||
label("lostmould")
|
||||
npc("A lost object is easy to replace. The loss of the affections of our Lord is impossible to forgive.")
|
||||
|
||||
label("blessing")
|
||||
exec { player, _ ->
|
||||
if (inInventory(player, Items.UNPOWERED_SYMBOL_1722)) {
|
||||
loadLabel(player, "canbless")
|
||||
}
|
||||
else loadLabel(player, "cannotbless")
|
||||
}
|
||||
|
||||
label("canbless")
|
||||
npc("I see you have the unholy symbol of our Lord. I will bless it for you.")
|
||||
line("The ghost mutters in a strange voice.", "The unholy symbol throbs with power.")
|
||||
exec { player, _ ->
|
||||
removeItem(player, Items.UNPOWERED_SYMBOL_1722)
|
||||
addItemOrDrop(player, Items.UNHOLY_SYMBOL_1724)
|
||||
}
|
||||
npc("The symbol of our Lord has been blessed with power! My master calls.")
|
||||
|
||||
|
||||
label("cannotbless")
|
||||
npc("No blessing will be given to those who have no symbol of our Lord's love.")
|
||||
|
||||
label("killyou")
|
||||
npc("The might of mortals, to me, is as the dust to the sea.")
|
||||
}
|
||||
}
|
||||
@@ -166,6 +166,18 @@ abstract class Cutscene(val player: Player) {
|
||||
player.dialogueInterpreter.addAction {_,_ -> onContinue.invoke()}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a non-NPC dialogue to the player, which updates the cutscene stage by default when continued
|
||||
* @param message the message to send
|
||||
* @param onContinue (optional) a method that runs when the dialogue is "continued." Increments the cutscene stage by default.
|
||||
*/
|
||||
fun dialogueLinesUpdate(vararg message: String, onContinue: () -> Unit = {incrementStage()})
|
||||
{
|
||||
logCutscene("Sending standard dialogue lines update.")
|
||||
sendDialogueLines(player, *message)
|
||||
player.dialogueInterpreter.addAction {_,_ -> onContinue.invoke()}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a player dialogue, which updates the cutscene stage by default when continued
|
||||
* @param expression the FacialExpression to use
|
||||
|
||||
Reference in New Issue
Block a user