Minor quest function refactors

Quest journal text improvements
This commit is contained in:
bushtail
2023-07-23 14:08:18 +00:00
committed by Ryan
parent 2e6eed69e6
commit 58fff59f1b
91 changed files with 152 additions and 180 deletions
@@ -17,7 +17,7 @@ class GCItemOnCat : InteractionListener {
val BEND_DOWN = 827 val BEND_DOWN = 827
onUseWith(IntType.NPC, Items.BUCKET_OF_MILK_1927, NPCs.GERTRUDES_CAT_2997) { player, used, with -> onUseWith(IntType.NPC, Items.BUCKET_OF_MILK_1927, NPCs.GERTRUDES_CAT_2997) { player, used, with ->
if(questStage(player, GERTCAT) == 20 && removeItem(player, used.asItem())){ if(getQuestStage(player, GERTCAT) == 20 && removeItem(player, used.asItem())){
addItem(player, Items.BUCKET_1925) addItem(player, Items.BUCKET_1925)
animate(player, BEND_DOWN) //bend down animate(player, BEND_DOWN) //bend down
sendChat(with.asNpc(), "Mew!") sendChat(with.asNpc(), "Mew!")
@@ -27,7 +27,7 @@ class GCItemOnCat : InteractionListener {
} }
onUseWith(IntType.NPC, Items.DOOGLE_SARDINE_1552, NPCs.GERTRUDES_CAT_2997){ player, used, with -> onUseWith(IntType.NPC, Items.DOOGLE_SARDINE_1552, NPCs.GERTRUDES_CAT_2997){ player, used, with ->
if(questStage(player, GERTCAT) == 30 && removeItem(player, used.asItem())){ if(getQuestStage(player, GERTCAT) == 30 && removeItem(player, used.asItem())){
animate(player, BEND_DOWN) animate(player, BEND_DOWN)
sendChat(with.asNpc(), "Mew!") sendChat(with.asNpc(), "Mew!")
setQuestStage(player, GERTCAT, 40) setQuestStage(player, GERTCAT, 40)
@@ -11,14 +11,14 @@ class RopeOnLadyKeli : InteractionListener {
val PAR = "Prince Ali Rescue" val PAR = "Prince Ali Rescue"
onUseWith(IntType.NPC, Items.ROPE_954, NPCs.LADY_KELI_919) { player, used, with -> onUseWith(IntType.NPC, Items.ROPE_954, NPCs.LADY_KELI_919) { player, used, with ->
if(questStage(player, PAR) in 40..50 && getAttribute(player, "guard-drunk", false)){ if(getQuestStage(player, PAR) in 40..50 && getAttribute(player, "guard-drunk", false)){
if(removeItem(player, used.asItem())){ if(removeItem(player, used.asItem())){
sendDialogue(player, "You overpower Keli, tie her up, and put her in a cupboard.") sendDialogue(player, "You overpower Keli, tie her up, and put her in a cupboard.")
setQuestStage(player, PAR, 50) setQuestStage(player, PAR, 50)
setAttribute(player, "keli-gone", getWorldTicks() + 350) setAttribute(player, "keli-gone", getWorldTicks() + 350)
} }
} else { } else {
if (questStage(player, PAR) == 40){ if (getQuestStage(player, PAR) == 40){
sendMessage(player, "You need to do something about the guard first.") sendMessage(player, "You need to do something about the guard first.")
} }
} }
@@ -9,7 +9,6 @@ import core.plugin.Initializable;
import core.game.node.entity.player.Player; import core.game.node.entity.player.Player;
import static core.api.ContentAPIKt.isQuestComplete; import static core.api.ContentAPIKt.isQuestComplete;
import static core.api.ContentAPIKt.questStage;
import static core.tools.DialogueConstKt.END_DIALOGUE; import static core.tools.DialogueConstKt.END_DIALOGUE;
/** /**
@@ -4,7 +4,6 @@ import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
import content.region.asgarnia.burthorpe.quest.deathplateau.DunstanDialogueFile import content.region.asgarnia.burthorpe.quest.deathplateau.DunstanDialogueFile
import core.api.isQuestInProgress import core.api.isQuestInProgress
import core.api.openDialogue import core.api.openDialogue
import core.api.questStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic import core.game.dialogue.Topic
@@ -2,8 +2,8 @@ package content.region.asgarnia.burthorpe.dialogue
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
import content.region.asgarnia.burthorpe.quest.deathplateau.EohricDialogueFile import content.region.asgarnia.burthorpe.quest.deathplateau.EohricDialogueFile
import core.api.getQuestStage
import core.api.openDialogue import core.api.openDialogue
import core.api.questStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
@@ -19,7 +19,7 @@ import org.rs09.consts.NPCs
@Initializable @Initializable
class EohricDialogue(player: Player? = null) : DialoguePlugin(player) { class EohricDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean { override fun handle(interfaceId: Int, buttonId: Int): Boolean {
if (questStage(player!!, DeathPlateau.questName) >= 5) { if (getQuestStage(player!!, DeathPlateau.questName) >= 5) {
// Call the dialogue file for Eohric from the deathplateau quest folder. // Call the dialogue file for Eohric from the deathplateau quest folder.
openDialogue(player!!, EohricDialogueFile(), npc) openDialogue(player!!, EohricDialogueFile(), npc)
return true return true
@@ -1,7 +1,7 @@
package content.region.asgarnia.burthorpe.quest.deathplateau package content.region.asgarnia.burthorpe.quest.deathplateau
import core.api.getQuestStage
import core.api.getScenery import core.api.getScenery
import core.api.questStage
import core.api.sendDialogue import core.api.sendDialogue
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
@@ -26,7 +26,7 @@ class DeathPlateauDoorDialogueFile(val door: Int) : DialogueFile() {
if(door == 2) { if(door == 2) {
npc = NPC(NPCs.TENZING_1071) npc = NPC(NPCs.TENZING_1071)
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
in 0 .. 19 -> { in 0 .. 19 -> {
when (stage) { when (stage) {
0 -> sendDialogue(player!!, "You knock on the door.").also { stage++ } 0 -> sendDialogue(player!!, "You knock on the door.").also { stage++ }
@@ -53,7 +53,7 @@ class DeathPlateauDoorDialogueFile(val door: Int) : DialogueFile() {
} }
if(door == 3) { if(door == 3) {
npc = NPC(NPCs.TENZING_1071) npc = NPC(NPCs.TENZING_1071)
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
in 0..24 -> { in 0..24 -> {
when (stage) { when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Where do you think you're going? This is private property!").also { stage = END_DIALOGUE } 0 -> npcl(FacialExpression.FRIENDLY, "Where do you think you're going? This is private property!").also { stage = END_DIALOGUE }
@@ -77,7 +77,7 @@ class DeathPlateauInteractionListener : InteractionListener {
GroundItemManager.get(Items.STONE_BALL_3111, location(2895, 3562, 0), player) != null && GroundItemManager.get(Items.STONE_BALL_3111, location(2895, 3562, 0), player) != null &&
GroundItemManager.get(Items.STONE_BALL_3112, location(2895, 3563, 0), player) != null && GroundItemManager.get(Items.STONE_BALL_3112, location(2895, 3563, 0), player) != null &&
GroundItemManager.get(Items.STONE_BALL_3113, location(2895, 3564, 0), player) != null) { GroundItemManager.get(Items.STONE_BALL_3113, location(2895, 3564, 0), player) != null) {
if (questStage(player, DeathPlateau.questName) == 16) { if (getQuestStage(player, DeathPlateau.questName) == 16) {
sendMessage(player, "The equipment room door has unlocked.") sendMessage(player, "The equipment room door has unlocked.")
setQuestStage(player, DeathPlateau.questName, 19) setQuestStage(player, DeathPlateau.questName, 19)
} }
@@ -86,7 +86,7 @@ class DeathPlateauInteractionListener : InteractionListener {
} }
on(Scenery.LARGE_DOOR_3743, SCENERY, "open") { player, node -> on(Scenery.LARGE_DOOR_3743, SCENERY, "open") { player, node ->
if (questStage(player, DeathPlateau.questName) > 16) { if (getQuestStage(player, DeathPlateau.questName) > 16) {
DoorActionHandler.handleAutowalkDoor(player, node as core.game.node.scenery.Scenery) DoorActionHandler.handleAutowalkDoor(player, node as core.game.node.scenery.Scenery)
} else { } else {
sendMessage(player, "The door is locked.") sendMessage(player, "The door is locked.")
@@ -20,7 +20,7 @@ import org.rs09.consts.NPCs
class DenulthDialogueFile : DialogueFile() { class DenulthDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
in 0..4 -> { in 0..4 -> {
when (stage) { when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ } 0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
@@ -13,7 +13,7 @@ import org.rs09.consts.NPCs
class DunstanDialogueFile : DialogueFile() { class DunstanDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
21 -> { 21 -> {
when (stage) { when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ } START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
@@ -1,9 +1,6 @@
package content.region.asgarnia.burthorpe.quest.deathplateau package content.region.asgarnia.burthorpe.quest.deathplateau
import core.api.getAttribute import core.api.*
import core.api.questStage
import core.api.setAttribute
import core.api.setQuestStage
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.dialogue.Topic import core.game.dialogue.Topic
@@ -20,7 +17,7 @@ import org.rs09.consts.NPCs
*/ */
class EohricDialogueFile : DialogueFile() { class EohricDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
in 5..9 -> { in 5..9 -> {
when (stage) { when (stage) {
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ } START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
@@ -38,7 +38,7 @@ class HaroldDialogueFile : DialogueFile() {
setAttribute(player!!, ATTRIBUTE_JUMPSTAGE, 0) setAttribute(player!!, ATTRIBUTE_JUMPSTAGE, 0)
} }
println(getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, -1)) println(getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, -1))
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
10 -> { // First time meeting. 10 -> { // First time meeting.
when (stage) { when (stage) {
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ } START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
@@ -9,7 +9,7 @@ import org.rs09.consts.Items
class IOUNoteDialogueFile : DialogueFile() { class IOUNoteDialogueFile : DialogueFile() {
var a = 0 var a = 0
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
in 15..16 -> { in 15..16 -> {
when (stage) { when (stage) {
0 -> player(FacialExpression.NEUTRAL, "The IOU says that Harold owes me some money.").also { stage++ } 0 -> player(FacialExpression.NEUTRAL, "The IOU says that Harold owes me some money.").also { stage++ }
@@ -9,7 +9,7 @@ import core.tools.END_DIALOGUE
class SabaDialogueFile : DialogueFile() { class SabaDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
19 -> { 19 -> {
when (stage) { when (stage) {
0 -> player(FacialExpression.FRIENDLY, "Hello!").also { stage++ } 0 -> player(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
@@ -11,7 +11,7 @@ class SecretWayLocation : MapArea {
} }
override fun areaEnter(entity: Entity) { override fun areaEnter(entity: Entity) {
if (entity is Player && questStage(entity, DeathPlateau.questName) == 25) { if (entity is Player && getQuestStage(entity, DeathPlateau.questName) == 25) {
sendPlayerDialogue(entity, "I think this is far enough, I can see Death Plateau and it looks like the trolls haven't found the path. I'd better go and tell Denulth.") sendPlayerDialogue(entity, "I think this is far enough, I can see Death Plateau and it looks like the trolls haven't found the path. I'd better go and tell Denulth.")
setQuestStage(entity, DeathPlateau.questName, 26) setQuestStage(entity, DeathPlateau.questName, 26)
} }
@@ -12,7 +12,7 @@ import org.rs09.consts.Items
class TenzingDialogueFile : DialogueFile() { class TenzingDialogueFile : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, DeathPlateau.questName)) { when (getQuestStage(player!!, DeathPlateau.questName)) {
20 -> { 20 -> {
when (stage) { when (stage) {
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ } START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
@@ -2,8 +2,8 @@ package content.region.asgarnia.trollheim.dialogue
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
import content.region.asgarnia.burthorpe.quest.deathplateau.SabaDialogueFile import content.region.asgarnia.burthorpe.quest.deathplateau.SabaDialogueFile
import core.api.getQuestStage
import core.api.openDialogue import core.api.openDialogue
import core.api.questStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
@@ -20,7 +20,7 @@ import org.rs09.consts.NPCs
@Initializable @Initializable
class SabaDialogue(player: Player? = null) : DialoguePlugin(player) { class SabaDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean { override fun handle(interfaceId: Int, buttonId: Int): Boolean {
if (questStage(player!!, DeathPlateau.questName) >= 19) { if (getQuestStage(player!!, DeathPlateau.questName) >= 19) {
openDialogue(player!!, SabaDialogueFile(), npc) openDialogue(player!!, SabaDialogueFile(), npc)
return true return true
} }
@@ -1,4 +1,4 @@
package content.region.desert.nardah.handlers; package content.region.desert.nardah.dialogue;
import core.game.node.item.Item; import core.game.node.item.Item;
import core.cache.def.impl.NPCDefinition; import core.cache.def.impl.NPCDefinition;
@@ -72,7 +72,7 @@ class TheGolemQuest : Quest("The Golem", 70, 69, 1, 437, 0, 1, 10) {
line(player, "The demon doesn't think its task is complete.", ln++, stage > 7) line(player, "The demon doesn't think its task is complete.", ln++, stage > 7)
} }
if(stage >= 100) { if(stage >= 100) {
line(player, "QUEST COMPLETE", ln++, false) line(player, "%%QUEST COMPLETE!&&", ln++, false)
} }
} }
@@ -1,7 +1,7 @@
package content.region.fremennik.rellekka.dialogue package content.region.fremennik.rellekka.dialogue
import content.region.fremennik.rellekka.quest.thefremenniktrials.CouncilWorkerFTDialogue import content.region.fremennik.rellekka.quest.thefremenniktrials.CouncilWorkerFTDialogue
import core.api.questStage import core.api.getQuestStage
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
@@ -12,7 +12,7 @@ import core.plugin.Initializable
class CouncilWorkerDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player){ class CouncilWorkerDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player){
override fun open(vararg args: Any?): Boolean { override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC npc = args[0] as NPC
if(questStage(player, "Fremennik Trials") in 1..99){ if(getQuestStage(player, "Fremennik Trials") in 1..99){
player.dialogueInterpreter.open((CouncilWorkerFTDialogue(1))) player.dialogueInterpreter.open((CouncilWorkerFTDialogue(1)))
} }
else if(player.achievementDiaryManager.getDiary(DiaryType.FREMENNIK).isComplete(0, true)){ else if(player.achievementDiaryManager.getDiary(DiaryType.FREMENNIK).isComplete(0, true)){
@@ -32,7 +32,7 @@ class CouncilWorkerFTDialogue(val questStage: Int, var isBeerInteraction: Boolea
else if(questStage in 1..99){ else if(questStage in 1..99){
when(stage){ when(stage){
START_DIALOGUE -> START_DIALOGUE ->
if(questStage(player!!, "Fremennik Trials") > 0) { if(getQuestStage(player!!, "Fremennik Trials") > 0) {
player("I know this is an odd question, but are you","a member of the elder council?"); stage = 1 player("I know this is an odd question, but are you","a member of the elder council?"); stage = 1
} else { } else {
end() end()
@@ -2,10 +2,8 @@ package content.region.fremennik.rellekka.quest.thefremenniktrials
import core.api.addItem import core.api.addItem
import core.api.dumpContainer import core.api.dumpContainer
import core.api.questStage import core.api.getQuestStage
import core.api.removeItem import core.api.removeItem
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import core.game.node.entity.player.link.diary.DiaryType import core.game.node.entity.player.link.diary.DiaryType
import core.plugin.Initializable import core.plugin.Initializable
@@ -81,7 +79,7 @@ class PeerTheSeerDialogue(player: Player? = null) : core.game.dialogue.DialogueP
stage = 50 stage = 50
return true return true
} }
if (questStage(player, "Fremennik Trials") == 0) { if (getQuestStage(player, "Fremennik Trials") == 0) {
npc(core.game.dialogue.FacialExpression.SAD,"Uuuh... What was that dark presence I felt?").also { stage = 300 } npc(core.game.dialogue.FacialExpression.SAD,"Uuuh... What was that dark presence I felt?").also { stage = 300 }
} }
return true return true
@@ -167,7 +167,7 @@ class TFTInteractionListeners : InteractionListener {
on(LYRE_IDs, IntType.ITEM, "play"){ player, lyre -> on(LYRE_IDs, IntType.ITEM, "play"){ player, lyre ->
if(getAttribute(player,"onStage",false) && !getAttribute(player,"lyreConcertPlayed",false)){ if(getAttribute(player,"onStage",false) && !getAttribute(player,"lyreConcertPlayed",false)){
Pulser.submit(LyreConcertPulse(player,lyre.id)) Pulser.submit(LyreConcertPulse(player,lyre.id))
} else if(questStage(player, "Fremennik Trials") < 20 || !isQuestComplete(player, "Fremennik Trials")){ } else if(getQuestStage(player, "Fremennik Trials") < 20 || !isQuestComplete(player, "Fremennik Trials")){
sendMessage(player,"You lack the knowledge to play this.") sendMessage(player,"You lack the knowledge to play this.")
} else if(LYRE_IDs.isLast(lyre.id)){ } else if(LYRE_IDs.isLast(lyre.id)){
sendMessage(player,"Your lyre is out of charges!") sendMessage(player,"Your lyre is out of charges!")
@@ -378,7 +378,7 @@ class TFTInteractionListeners : InteractionListener {
"I've joined the Legends' Guild!" "I've joined the Legends' Guild!"
) )
var counter = 0 var counter = 0
val questPoints = getQP(player) val questPoints = getQuestPoints(player)
val champGuild = player.achievementDiaryManager?.hasCompletedTask(DiaryType.VARROCK, 1, 1)?: false val champGuild = player.achievementDiaryManager?.hasCompletedTask(DiaryType.VARROCK, 1, 1)?: false
val legGuild = questPoints >= 111 val legGuild = questPoints >= 111
val heroGuild = questPoints >= 5 val heroGuild = questPoints >= 5
@@ -24,7 +24,7 @@ class AlrenaDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
0 -> when (stage) { 0 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Oh, hello there.").also { stage++ } 1 -> npcl(FacialExpression.NEUTRAL, "Oh, hello there.").also { stage++ }
@@ -30,7 +30,7 @@ class BravekDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
13 -> when (stage) { 13 -> when (stage) {
1 -> playerl(FacialExpression.FRIENDLY, "This is really important though!").also { stage = 2 } 1 -> playerl(FacialExpression.FRIENDLY, "This is really important though!").also { stage = 2 }
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.questStage import core.api.getQuestStage
import core.api.sendNPCDialogue import core.api.sendNPCDialogue
import core.api.setQuestStage import core.api.setQuestStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
@@ -21,7 +21,7 @@ class ClerkDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
11 -> when (stage) { 11 -> when (stage) {
0 -> options("Who is through that door?", "I'm just looking thanks.").also { stage++ } 0 -> options("Who is through that door?", "I'm just looking thanks.").also { stage++ }
@@ -26,7 +26,7 @@ class EdmondDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
0 -> when (stage) { 0 -> when (stage) {
1 -> npcl(FacialExpression.NEUTRAL, "Sorry, I can't stop to talk...").also { stage++ } 1 -> npcl(FacialExpression.NEUTRAL, "Sorry, I can't stop to talk...").also { stage++ }
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.questStage import core.api.getQuestStage
import core.api.setQuestStage import core.api.setQuestStage
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
@@ -13,7 +13,7 @@ import org.rs09.consts.NPCs
class HeadMournerDialogue : DialogueFile() { class HeadMournerDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.HEAD_MOURNER_716) npc = NPC(NPCs.HEAD_MOURNER_716)
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
in 8..10 -> when (stage) { in 8..10 -> when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Hmmm, how did you get over here? You're not one of this rabble. Ah well, you'll have to stay. Can't risk you going back now.").also { stage++ } 0 -> npcl(FacialExpression.FRIENDLY, "Hmmm, how did you get over here? You're not one of this rabble. Ah well, you'll have to stay. Can't risk you going back now.").also { stage++ }
@@ -24,7 +24,7 @@ class JethickDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
in 0..1 -> when (stage) { in 0..1 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "Well King Tyras has wandered off into the west kingdom. He doesn't care about the mess he's left here. The city warder Bravek is in charge at the moment... He's not much better.").also { stage = END_DIALOGUE } 1 -> npcl(FacialExpression.FRIENDLY, "Well King Tyras has wandered off into the west kingdom. He doesn't care about the mess he's left here. The city warder Bravek is in charge at the moment... He's not much better.").also { stage = END_DIALOGUE }
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.questStage import core.api.getQuestStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
@@ -23,7 +23,7 @@ class MarthaRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
9 -> when (stage) { 9 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "Yes she was staying here, but slightly over a week ago she was getting ready to go back.").also { stage++ } 1 -> npcl(FacialExpression.FRIENDLY, "Yes she was staying here, but slightly over a week ago she was getting ready to go back.").also { stage++ }
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.questStage import core.api.getQuestStage
import core.api.setQuestStage import core.api.setQuestStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
@@ -24,7 +24,7 @@ class MilliRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
9 -> when(stage) { 9 -> when(stage) {
1 -> npcl(FacialExpression.NEUTRAL, "*sniff* Yes I was near the south east corner when I saw Elena walking by. I was about to run to greet her when some men jumped out. They shoved a sack over her head and dragged her into a building.").also { stage++ } 1 -> npcl(FacialExpression.NEUTRAL, "*sniff* Yes I was near the south east corner when I saw Elena walking by. I was about to run to greet her when some men jumped out. They shoved a sack over her head and dragged her into a building.").also { stage++ }
@@ -14,7 +14,7 @@ import org.rs09.consts.NPCs
class MournerDialogue : DialogueFile() { class MournerDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.MOURNER_3216) npc = NPC(NPCs.MOURNER_3216)
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
in 0..6 -> when (stage) { in 0..6 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello.").also { stage++ } 0 -> playerl(FacialExpression.FRIENDLY, "Hello.").also { stage++ }
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.plaguecity.quest.elena package content.region.kandarin.ardougne.plaguecity.quest.elena
import core.api.questStage import core.api.getQuestStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
@@ -25,7 +25,7 @@ class TedRehnisonDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, PlagueCity.PlagueCityQuest)) { when (getQuestStage(player!!, PlagueCity.PlagueCityQuest)) {
9 -> when (stage) { 9 -> when (stage) {
1 -> npcl(FacialExpression.FRIENDLY, "Yes she was staying here, but slightly over a week ago she was getting ready to go back. However she never managed to leave. My daughter Milli was playing near the west wall when she saw some shadowy figures jump").also { stage++ } 1 -> npcl(FacialExpression.FRIENDLY, "Yes she was staying here, but slightly over a week ago she was getting ready to go back. However she never managed to leave. My daughter Milli was playing near the west wall when she saw some shadowy figures jump").also { stage++ }
@@ -81,7 +81,7 @@ class FightArena : Quest("Fight Arena", 61, 60, 2, 17, 0, 1, 14) {
} }
if (stage == 100) { if (stage == 100) {
line++ line++
line(player, "!!QUEST COMPLETE??", line) line(player, "%%QUEST COMPLETE!&&", line)
} }
} }
@@ -15,7 +15,7 @@ import org.rs09.consts.NPCs
class ALazyGuardDialogue : DialogueFile() { class ALazyGuardDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.A_LAZY_KHAZARD_GUARD_8498) npc = NPC(NPCs.A_LAZY_KHAZARD_GUARD_8498)
when (questStage(player!!, FightArena.FightArenaQuest)) { when (getQuestStage(player!!, FightArena.FightArenaQuest)) {
in 40..49 -> when (stage) { in 40..49 -> when (stage) {
0 -> { 0 -> {
@@ -16,7 +16,7 @@ import org.rs09.consts.NPCs
class GeneralKhazardDialogue : DialogueFile() { class GeneralKhazardDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.GENERAL_KHAZARD_258) npc = NPC(NPCs.GENERAL_KHAZARD_258)
when (questStage(player!!, FightArena.FightArenaQuest)) { when (getQuestStage(player!!, FightArena.FightArenaQuest)) {
in 68..70 -> when(stage){ in 68..70 -> when(stage){
0 -> npcl(FacialExpression.FRIENDLY, "Out of the way, guard! I don't tolerate disruption when I'm watching slaves being slaughtered.").also { stage = END_DIALOGUE } 0 -> npcl(FacialExpression.FRIENDLY, "Out of the way, guard! I don't tolerate disruption when I'm watching slaves being slaughtered.").also { stage = END_DIALOGUE }
@@ -11,7 +11,7 @@ import org.rs09.consts.NPCs
class HengradDialogue : DialogueFile() { class HengradDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.HENGRAD_263) npc = NPC(NPCs.HENGRAD_263)
when (questStage(player!!, FightArena.FightArenaQuest)) { when (getQuestStage(player!!, FightArena.FightArenaQuest)) {
in 72..87 -> when (stage) { in 72..87 -> when (stage) {
0 -> { 0 -> {
@@ -13,7 +13,7 @@ class JeremyServilADialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.JEREMY_SERVIL_265) npc = NPC(NPCs.JEREMY_SERVIL_265)
when (questStage(player!!, FightArena.FightArenaQuest)) { when (getQuestStage(player!!, FightArena.FightArenaQuest)) {
20 -> when (stage) { 20 -> when (stage) {
0 -> { 0 -> {
@@ -12,7 +12,7 @@ class JeremyServilBDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.JEREMY_SERVIL_266) npc = NPC(NPCs.JEREMY_SERVIL_266)
when (questStage(player!!, FightArena.FightArenaQuest)) { when (getQuestStage(player!!, FightArena.FightArenaQuest)) {
in 1..84 -> when (stage) { in 1..84 -> when (stage) {
0 -> { 0 -> {
@@ -3,7 +3,7 @@ package content.region.kandarin.ardougne.quest.arena.dialogue
import content.region.kandarin.ardougne.quest.arena.FightArena import content.region.kandarin.ardougne.quest.arena.FightArena
import core.api.face import core.api.face
import core.api.findNPC import core.api.findNPC
import core.api.questStage import core.api.getQuestStage
import core.api.sendNPCDialogue import core.api.sendNPCDialogue
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
@@ -14,7 +14,7 @@ import org.rs09.consts.NPCs
class JustinServilDialogue : DialogueFile() { class JustinServilDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.JUSTIN_SERVIL_267) npc = NPC(NPCs.JUSTIN_SERVIL_267)
when (questStage(player!!, FightArena.FightArenaQuest)) { when (getQuestStage(player!!, FightArena.FightArenaQuest)) {
in 1..68 -> when (stage) { in 1..68 -> when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello.").also { stage++ } 0 -> playerl(FacialExpression.FRIENDLY, "Hello.").also { stage++ }
@@ -2,7 +2,7 @@ package content.region.kandarin.ardougne.quest.arena.dialogue
import content.region.kandarin.ardougne.quest.arena.FightArena import content.region.kandarin.ardougne.quest.arena.FightArena
import core.api.addItem import core.api.addItem
import core.api.questStage import core.api.getQuestStage
import core.api.removeItem import core.api.removeItem
import core.api.setQuestStage import core.api.setQuestStage
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
@@ -17,7 +17,7 @@ import org.rs09.consts.NPCs
class KhazardBarmanDialogue : DialogueFile() { class KhazardBarmanDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.KHAZARD_BARMAN_259) npc = NPC(NPCs.KHAZARD_BARMAN_259)
when (questStage(player!!, FightArena.FightArenaQuest)) { when (getQuestStage(player!!, FightArena.FightArenaQuest)) {
in 0..49 -> { in 0..49 -> {
when (stage) { when (stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello. I'll have a beer please.").also { stage = 1 } 0 -> playerl(FacialExpression.HAPPY, "Hello. I'll have a beer please.").also { stage = 1 }
@@ -1,7 +1,7 @@
package content.region.kandarin.ardougne.quest.arena.dialogue package content.region.kandarin.ardougne.quest.arena.dialogue
import content.region.kandarin.ardougne.quest.arena.FightArena.Companion.FightArenaQuest import content.region.kandarin.ardougne.quest.arena.FightArena.Companion.FightArenaQuest
import core.api.questStage import core.api.getQuestStage
import core.api.setQuestStage import core.api.setQuestStage
import core.game.dialogue.DialoguePlugin import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
@@ -29,7 +29,7 @@ class LadyServilDialogue(player: Player? = null) : DialoguePlugin(player) {
} }
override fun handle(componentID: Int, buttonID: Int): Boolean { override fun handle(componentID: Int, buttonID: Int): Boolean {
when (questStage(player!!, FightArenaQuest)) { when (getQuestStage(player!!, FightArenaQuest)) {
0 -> when (stage) { 0 -> when (stage) {
0 -> npcl(FacialExpression.SAD, "Oh I wish this broken cart was my only problem. *sob* I've got to find my family.. **sob**").also { stage++ } 0 -> npcl(FacialExpression.SAD, "Oh I wish this broken cart was my only problem. *sob* I've got to find my family.. **sob**").also { stage++ }
@@ -53,7 +53,7 @@ class BouncerNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, loca
override fun finalizeDeath(killer: Entity?) { override fun finalizeDeath(killer: Entity?) {
if (killer is Player) { if (killer is Player) {
val quest = "Fight Arena" val quest = "Fight Arena"
if (questStage(killer, quest) >= 89) { if (getQuestStage(killer, quest) >= 89) {
setQuestStage(killer, FightArena.FightArenaQuest, 91) setQuestStage(killer, FightArena.FightArenaQuest, 91)
} }
removeAttribute(killer, "spawn-bouncer") removeAttribute(killer, "spawn-bouncer")
@@ -4,7 +4,7 @@ import content.region.kandarin.ardougne.quest.arena.FightArena
import content.region.kandarin.ardougne.quest.arena.FightArenaListeners.Companion.General import content.region.kandarin.ardougne.quest.arena.FightArenaListeners.Companion.General
import content.region.kandarin.ardougne.quest.arena.dialogue.JeremyServilBDialogue import content.region.kandarin.ardougne.quest.arena.dialogue.JeremyServilBDialogue
import core.api.openDialogue import core.api.openDialogue
import core.api.questStage import core.api.getQuestStage
import core.api.setQuestStage import core.api.setQuestStage
import core.game.node.entity.Entity import core.game.node.entity.Entity
import core.game.node.entity.npc.AbstractNPC import core.game.node.entity.npc.AbstractNPC
@@ -32,7 +32,7 @@ class GeneralNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, loca
override fun finalizeDeath(killer: Entity?) { override fun finalizeDeath(killer: Entity?) {
if (killer is Player) { if (killer is Player) {
val quest = "Fight Arena" val quest = "Fight Arena"
if (questStage(killer, quest) == 97) { if (getQuestStage(killer, quest) == 97) {
setQuestStage(killer, FightArena.FightArenaQuest, 98) setQuestStage(killer, FightArena.FightArenaQuest, 98)
} }
openDialogue(killer, JeremyServilBDialogue()) openDialogue(killer, JeremyServilBDialogue())
@@ -54,7 +54,7 @@ class OgreNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, locatio
override fun finalizeDeath(killer: Entity?) { override fun finalizeDeath(killer: Entity?) {
if (killer is Player) { if (killer is Player) {
val quest = "Fight Arena" val quest = "Fight Arena"
if (questStage(killer, quest) == 68 || questStage(killer, quest) == 88) { if (getQuestStage(killer, quest) == 68 || getQuestStage(killer, quest) == 88) {
setQuestStage(killer, FightArena.FightArenaQuest, 72) setQuestStage(killer, FightArena.FightArenaQuest, 72)
} }
clearHintIcon(killer) clearHintIcon(killer)
@@ -53,7 +53,7 @@ class ScorpionNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, loc
override fun finalizeDeath(killer: Entity?) { override fun finalizeDeath(killer: Entity?) {
if (killer is Player) { if (killer is Player) {
val quest = "Fight Arena" val quest = "Fight Arena"
if (questStage(killer, quest) == 88) { if (getQuestStage(killer, quest) == 88) {
setQuestStage(killer, FightArena.FightArenaQuest, 89) setQuestStage(killer, FightArena.FightArenaQuest, 89)
} }
removeAttribute(killer, "spawn-scorpion") removeAttribute(killer, "spawn-scorpion")
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.quest.monksfriend package content.region.kandarin.ardougne.quest.monksfriend
import core.api.questStage import core.api.getQuestStage
import core.api.sendItemDialogue import core.api.sendItemDialogue
import core.api.setQuestStage import core.api.setQuestStage
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
@@ -19,7 +19,7 @@ import core.tools.END_DIALOGUE
class BrotherCedricDialogue : DialogueFile() { class BrotherCedricDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questName = "Monk's Friend" val questName = "Monk's Friend"
val questStage = questStage(player!!, questName) val questStage = getQuestStage(player!!, questName)
when { when {
questStage < 30 -> { questStage < 30 -> {
when(stage) { when(stage) {
@@ -23,7 +23,7 @@ import core.tools.END_DIALOGUE
class BrotherOmadDialogue : DialogueFile() { class BrotherOmadDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questName = "Monk's Friend" val questName = "Monk's Friend"
val questStage = questStage(player!!, questName) val questStage = getQuestStage(player!!, questName)
when (questStage) { when (questStage) {
0 -> { 0 -> {
when(stage) { when(stage) {
@@ -48,6 +48,8 @@ class MonksFriend: Quest("Monk's Friend", 89, 88, 1, 30, 0, 1, 80) {
} }
if(stage == 100){ if(stage == 100){
line(player, "I had a party with the Monks. There were party balloons and we danced the night away!", line++, true) line(player, "I had a party with the Monks. There were party balloons and we danced the night away!", line++, true)
line++
line(player, "%%QUEST COMPLETE!&&", line++)
} }
} }
@@ -66,7 +66,7 @@ public class SheepHerder extends Quest {
case 100: case 100:
line(player,"I helped Councillor Halgrive by putting down",line++,true); line(player,"I helped Councillor Halgrive by putting down",line++,true);
line(player,"plague-bearing sheep.",line++,true); line(player,"plague-bearing sheep.",line++,true);
line(player,"!!QUEST COMPLETE",line++); line(player,"%%QUEST COMPLETE!&&",line++);
break; break;
} }
} }
@@ -103,7 +103,7 @@ class ChompyBird : Quest("Big Chompy Bird Hunting", 35, 34, 2, Vars.VARP_QUEST_C
line(player, "- ${if(getAttribute(player, ATTR_FYCIE_ASKED, false)) "Fycie wants: !!${getItemName(getAttribute(player, ATTR_ING_FYCIE, -1))}??" else "I still need to ask !!Fycie??."}", ln++, false) line(player, "- ${if(getAttribute(player, ATTR_FYCIE_ASKED, false)) "Fycie wants: !!${getItemName(getAttribute(player, ATTR_ING_FYCIE, -1))}??" else "I still need to ask !!Fycie??."}", ln++, false)
} else if (stage > 70) { } else if (stage > 70) {
line(player, "I seasoned and cooked the chompy bird for Rantz and his kids.", ln++, true) line(player, "I seasoned and cooked the chompy bird for Rantz and his kids.", ln++, true)
line(player, "!!QUEST COMPLETE!??", ln++, false) line(player, "%%QUEST COMPLETE!&&", ln++, false)
} }
} }
} }
@@ -37,7 +37,7 @@ public class FishingContest extends Quest {
line(player,"I should return to !!Austri?? or !!Vestri??.",line++); line(player,"I should return to !!Austri?? or !!Vestri??.",line++);
if(stage >= 100){ if(stage >= 100){
line(player,"!!QUEST COMPLETE",line++); line(player,"%%QUEST COMPLETE!&&",line++);
} }
} }
} }
@@ -1,7 +1,7 @@
package content.region.kandarin.quest.grandtree package content.region.kandarin.quest.grandtree
import core.api.addItemOrDrop import core.api.addItemOrDrop
import core.api.questStage import core.api.getQuestStage
import core.api.sendDialogue import core.api.sendDialogue
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.node.item.Item import core.game.node.item.Item
@@ -10,7 +10,7 @@ import org.rs09.consts.Items
class AnitaDialogue : DialogueFile(){ class AnitaDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when(questStage(player!!, TheGrandTree.questName)){ when(getQuestStage(player!!, TheGrandTree.questName)){
60 -> { 60 -> {
if(player!!.hasItem(Item(Items.GLOUGHS_KEY_788)) && stage < 12){ if(player!!.hasItem(Item(Items.GLOUGHS_KEY_788)) && stage < 12){
when(stage){ when(stage){
@@ -1,8 +1,7 @@
package content.region.kandarin.quest.grandtree package content.region.kandarin.quest.grandtree
import content.global.travel.glider.Gliders import content.global.travel.glider.Gliders
import core.api.questStage import core.api.getQuestStage
import core.api.setQuestStage
import core.api.teleport import core.api.teleport
import core.game.component.Component import core.game.component.Component
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
@@ -11,7 +10,7 @@ import core.tools.END_DIALOGUE
class CaptainErrdoDialogue: DialogueFile(){ class CaptainErrdoDialogue: DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when(questStage(player!!, TheGrandTree.questName)){ when(getQuestStage(player!!, TheGrandTree.questName)){
55 -> { 55 -> {
if(player!!.location.regionId == 11567){ if(player!!.location.regionId == 11567){
when(stage){ when(stage){
@@ -1,28 +1,23 @@
package content.region.kandarin.quest.grandtree package content.region.kandarin.quest.grandtree
import content.region.kandarin.quest.grandtree.TheGrandTree.Companion.questName import content.region.kandarin.quest.grandtree.TheGrandTree.Companion.questName
import content.region.misthalin.varrock.quest.familycrest.doDoor
import core.api.* import core.api.*
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.global.action.DoorActionHandler import core.game.global.action.DoorActionHandler
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.item.Item import core.game.node.item.Item
import core.game.node.scenery.SceneryBuilder
import core.game.system.task.Pulse import core.game.system.task.Pulse
import core.game.world.GameWorld import core.game.world.GameWorld
import core.game.world.map.Direction import core.game.world.map.Direction
import core.game.world.map.Location import core.game.world.map.Location
import core.game.world.update.flag.context.Animation
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
import org.rs09.consts.Items import org.rs09.consts.Items
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import org.rs09.consts.Scenery
class CharlieDialogue : DialogueFile() { class CharlieDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, questName)) { when (getQuestStage(player!!, questName)) {
46 -> { 46 -> {
when (stage) { when (stage) {
0 -> playerl("Tell me. Why would you want to kill the Grand Tree?").also { stage++ } 0 -> playerl("Tell me. Why would you want to kill the Grand Tree?").also { stage++ }
@@ -12,14 +12,9 @@ import core.plugin.Initializable
import org.rs09.consts.Items import org.rs09.consts.Items
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.interaction.MovementPulse
import core.game.node.entity.impl.PulseType
import core.game.node.entity.npc.NPC
import core.game.system.task.Pulse import core.game.system.task.Pulse
import core.game.world.GameWorld import core.game.world.GameWorld
import core.game.world.map.Direction
import core.game.world.map.RegionManager import core.game.world.map.RegionManager
import core.game.world.map.path.Pathfinder
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
import org.rs09.consts.Components import org.rs09.consts.Components
@@ -42,7 +37,7 @@ class ForemanNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id,locat
} }
override fun finalizeDeath(killer: Entity?) { override fun finalizeDeath(killer: Entity?) {
if(questStage(killer as Player, TheGrandTree.questName) == 55) { if(getQuestStage(killer as Player, TheGrandTree.questName) == 55) {
sendMessage(killer,"The foreman drops a piece of paper as he dies.") sendMessage(killer,"The foreman drops a piece of paper as he dies.")
produceGroundItem(killer, Items.LUMBER_ORDER_787, 1, this.location) produceGroundItem(killer, Items.LUMBER_ORDER_787, 1, this.location)
} }
@@ -4,27 +4,18 @@ import content.region.kandarin.quest.grandtree.TheGrandTree.Companion.questName
import core.api.* import core.api.*
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression import core.game.dialogue.FacialExpression
import core.game.interaction.MovementPulse
import core.game.node.entity.impl.PulseType
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.item.Item
import core.game.node.scenery.Scenery
import core.game.node.scenery.SceneryBuilder
import core.game.system.task.Pulse import core.game.system.task.Pulse
import core.game.world.GameWorld import core.game.world.GameWorld
import core.game.world.map.Direction import core.game.world.map.Direction
import core.game.world.map.Location import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.game.world.map.path.Pathfinder
import core.game.world.update.flag.context.Animation import core.game.world.update.flag.context.Animation
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
class GloughDialogue : DialogueFile() { class GloughDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, questName)) { when (getQuestStage(player!!, questName)) {
40 -> { 40 -> {
when (stage) { when (stage) {
0 -> playerl("Hello.").also { stage++ } 0 -> playerl("Hello.").also { stage++ }
@@ -114,7 +114,7 @@ class GrandTreeListeners: InteractionListener {
SceneryBuilder.replace(Scenery(2436, Location(2482,3462,1)),Scenery(2437, Location(2482,3462,1)),2) SceneryBuilder.replace(Scenery(2436, Location(2482,3462,1)),Scenery(2437, Location(2482,3462,1)),2)
sendDialogue(player,"You found a scroll!") sendDialogue(player,"You found a scroll!")
addItemOrDrop(player, Items.INVASION_PLANS_794) addItemOrDrop(player, Items.INVASION_PLANS_794)
if(questStage(player!!, questName) < 60) if(getQuestStage(player!!, questName) < 60)
setQuestStage(player!!, questName, 60) setQuestStage(player!!, questName, 60)
return@onUseWith true return@onUseWith true
} }
@@ -164,7 +164,7 @@ class GrandTreeListeners: InteractionListener {
return@on true return@on true
} }
on(2435, IntType.SCENERY, "search"){ player, _ -> on(2435, IntType.SCENERY, "search"){ player, _ ->
if(questStage(player, questName) == 47){ if(getQuestStage(player, questName) == 47){
sendItemDialogue(player, Items.GLOUGHS_JOURNAL_785,"You've found Glough's Journal!") sendItemDialogue(player, Items.GLOUGHS_JOURNAL_785,"You've found Glough's Journal!")
addItemOrDrop(player, Items.GLOUGHS_JOURNAL_785) addItemOrDrop(player, Items.GLOUGHS_JOURNAL_785)
} }
@@ -173,7 +173,7 @@ class GrandTreeListeners: InteractionListener {
// Roots for Daconia rock // Roots for Daconia rock
on(32319, IntType.SCENERY, "search"){ player, node -> on(32319, IntType.SCENERY, "search"){ player, node ->
if(questStage(player, questName) < 99 || player.hasItem(Item(Items.DACONIA_ROCK_793))){ return@on true; } if(getQuestStage(player, questName) < 99 || player.hasItem(Item(Items.DACONIA_ROCK_793))){ return@on true; }
// RNG for which root the rock is under // RNG for which root the rock is under
if(node.location == roots[getAttribute(player,"grandtree:rock",1)]){ if(node.location == roots[getAttribute(player,"grandtree:rock",1)]){
sendItemDialogue(player, Item(Items.DACONIA_ROCK_793), "You've found a Daconia rock!") sendItemDialogue(player, Item(Items.DACONIA_ROCK_793), "You've found a Daconia rock!")
@@ -3,26 +3,14 @@ package content.region.kandarin.quest.grandtree
import content.region.kandarin.quest.grandtree.TheGrandTree.Companion.questName import content.region.kandarin.quest.grandtree.TheGrandTree.Companion.questName
import core.api.* import core.api.*
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.interaction.MovementPulse
import core.game.node.entity.impl.PulseType
import core.game.node.item.Item import core.game.node.item.Item
import core.game.node.scenery.Scenery
import core.game.node.scenery.SceneryBuilder
import core.game.system.task.Pulse
import core.game.world.GameWorld
import core.game.world.map.Direction
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.game.world.map.path.Pathfinder
import core.game.world.update.flag.context.Animation
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
import org.rs09.consts.Items import org.rs09.consts.Items
import org.rs09.consts.NPCs
class HazelmereDialogue : DialogueFile() { class HazelmereDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, questName)) { when (getQuestStage(player!!, questName)) {
10 -> { 10 -> {
if(player!!.hasItem(Item(Items.BARK_SAMPLE_783))){ if(player!!.hasItem(Item(Items.BARK_SAMPLE_783))){
when (stage) { when (stage) {
@@ -67,7 +67,7 @@ class KingNarnodeDialogue : DialogueFile() {
}) })
} }
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when (questStage(player!!, questName)) { when (getQuestStage(player!!, questName)) {
0 -> { 0 -> {
when (stage) { when (stage) {
0 -> npcl("Welcome Traveller. I am King Narnode. It's nice to see an outsider.").also { stage++ } 0 -> npcl("Welcome Traveller. I am King Narnode. It's nice to see an outsider.").also { stage++ }
@@ -383,7 +383,7 @@ class KingNarnodeUnderGroundDialogue : DialogueFile() {
}) })
} }
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when(questStage(player!!, questName)) { when(getQuestStage(player!!, questName)) {
98 -> when (stage) { 98 -> when (stage) {
0 -> npcl("Traveller, you're wounded! What happened?").also { stage++ } 0 -> npcl("Traveller, you're wounded! What happened?").also { stage++ }
1 -> playerl("It's Glough! He set a demon on me!").also { stage++ } 1 -> playerl("It's Glough! He set a demon on me!").also { stage++ }
@@ -1,7 +1,7 @@
package content.region.kandarin.quest.grandtree package content.region.kandarin.quest.grandtree
import core.api.getAttribute import core.api.getAttribute
import core.api.questStage import core.api.getQuestStage
import core.api.setAttribute import core.api.setAttribute
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.game.global.action.DoorActionHandler import core.game.global.action.DoorActionHandler
@@ -13,7 +13,7 @@ class ShipyardWorkerDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
when(stage){ when(stage){
0 -> npcl("Hey you! What are you up to?").also { 0 -> npcl("Hey you! What are you up to?").also {
if(questStage(player!!, TheGrandTree.questName) == 55) { if(getQuestStage(player!!, TheGrandTree.questName) == 55) {
setAttribute(player!!, "/save:grandtree:opt1", false) setAttribute(player!!, "/save:grandtree:opt1", false)
setAttribute(player!!, "/save:grandtree:opt2", false) setAttribute(player!!, "/save:grandtree:opt2", false)
setAttribute(player!!, "/save:grandtree:opt3", false) setAttribute(player!!, "/save:grandtree:opt3", false)
@@ -6,7 +6,7 @@ import core.tools.END_DIALOGUE
class BallistaDialogue : DialogueFile(){ class BallistaDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, TreeGnomeVillage.questName) val questStage = getQuestStage(player!!, TreeGnomeVillage.questName)
if (questStage > 30) { if (questStage > 30) {
when (stage) { when (stage) {
0 -> sendDialogue(player!!, "The Khazard stronghold has already been breached.").also { stage = END_DIALOGUE } 0 -> sendDialogue(player!!, "The Khazard stronghold has already been breached.").also { stage = END_DIALOGUE }
@@ -7,7 +7,7 @@ import core.tools.END_DIALOGUE
class CommanderMontaiDialogue : DialogueFile(){ class CommanderMontaiDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, TreeGnomeVillage.questName) val questStage = getQuestStage(player!!, TreeGnomeVillage.questName)
if (questStage == 10) { if (questStage == 10) {
when(stage) { when(stage) {
0 -> playerl("Hello.").also { stage++ } 0 -> playerl("Hello.").also { stage++ }
@@ -38,7 +38,7 @@ class ElkoyDialogue : DialogueFile(){
}) })
} }
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, questName) val questStage = getQuestStage(player!!, questName)
val locY = player!!.location.y val locY = player!!.location.y
val followLocation = if(locY > 3161) "village" else "exit" val followLocation = if(locY > 3161) "village" else "exit"
when { when {
@@ -1,12 +1,12 @@
package content.region.kandarin.quest.tree package content.region.kandarin.quest.tree
import core.api.questStage import core.api.getQuestStage
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
class KhazardWarlordDialogue : DialogueFile(){ class KhazardWarlordDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, TreeGnomeVillage.questName) val questStage = getQuestStage(player!!, TreeGnomeVillage.questName)
if(questStage == 31){ if(questStage == 31){
when(stage) { when(stage) {
0 -> playerl("Hello there.").also { stage++ } 0 -> playerl("Hello there.").also { stage++ }
@@ -1,7 +1,7 @@
package content.region.kandarin.quest.tree package content.region.kandarin.quest.tree
import core.api.addItemOrDrop import core.api.addItemOrDrop
import core.api.questStage import core.api.getQuestStage
import core.api.sendDialogue import core.api.sendDialogue
import core.game.node.entity.Entity import core.game.node.entity.Entity
import core.game.node.entity.npc.AbstractNPC import core.game.node.entity.npc.AbstractNPC
@@ -27,7 +27,7 @@ class KhazardWarlordNPC(id: Int = 0, location: Location? = null) : AbstractNPC(i
} }
override fun finalizeDeath(killer: Entity?) { override fun finalizeDeath(killer: Entity?) {
if(questStage(killer as Player, TreeGnomeVillage.questName) == 40) { if(getQuestStage(killer as Player, TreeGnomeVillage.questName) == 40) {
sendDialogue(killer,"As the warlord falls to the ground, a ghostly vapour floats upwards from his battle-worn armour. You search his satchel and find the orbs of protection.") sendDialogue(killer,"As the warlord falls to the ground, a ghostly vapour floats upwards from his battle-worn armour. You search his satchel and find the orbs of protection.")
addItemOrDrop(killer, Items.ORBS_OF_PROTECTION_588) addItemOrDrop(killer, Items.ORBS_OF_PROTECTION_588)
} }
@@ -15,7 +15,7 @@ import core.tools.END_DIALOGUE
class KingBolrenDialogue : DialogueFile() { class KingBolrenDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, questName) val questStage = getQuestStage(player!!, questName)
when { when {
questStage < 10 -> { questStage < 10 -> {
when (stage) { when (stage) {
@@ -1,14 +1,14 @@
package content.region.kandarin.quest.tree package content.region.kandarin.quest.tree
import core.api.inInventory import core.api.inInventory
import core.api.questStage import core.api.getQuestStage
import org.rs09.consts.Items import org.rs09.consts.Items
import core.game.dialogue.DialogueFile import core.game.dialogue.DialogueFile
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
class RemsaiDialogue : DialogueFile(){ class RemsaiDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, TreeGnomeVillage.questName) val questStage = getQuestStage(player!!, TreeGnomeVillage.questName)
when { when {
inInventory(player!!,Items.ORBS_OF_PROTECTION_588) -> { inInventory(player!!,Items.ORBS_OF_PROTECTION_588) -> {
when(stage) { when(stage) {
@@ -7,7 +7,7 @@ import core.tools.END_DIALOGUE
class TrackerGnomeOneDialogue : DialogueFile(){ class TrackerGnomeOneDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, TreeGnomeVillage.questName) val questStage = getQuestStage(player!!, TreeGnomeVillage.questName)
when { when {
questStage >= 40 -> { questStage >= 40 -> {
when (stage) { when (stage) {
@@ -13,7 +13,7 @@ class TrackerGnomeThreeDialogue : DialogueFile(){
4 to "My legs and your legs.") 4 to "My legs and your legs.")
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, TreeGnomeVillage.questName) val questStage = getQuestStage(player!!, TreeGnomeVillage.questName)
when { when {
questStage == 30 -> { questStage == 30 -> {
when(stage) { when(stage) {
@@ -7,7 +7,7 @@ import core.tools.END_DIALOGUE
class TrackerGnomeTwoDialogue : DialogueFile(){ class TrackerGnomeTwoDialogue : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
val questStage = questStage(player!!, TreeGnomeVillage.questName) val questStage = getQuestStage(player!!, TreeGnomeVillage.questName)
when { when {
questStage == 30 -> { questStage == 30 -> {
when (stage) { when (stage) {
@@ -85,7 +85,7 @@ class TreeGnomeVillage: Quest("Tree Gnome Village", 125, 124, 2, 111, 0, 1, 9)
line++ line++
} }
if (stage == 100) { if (stage == 100) {
line(player,"QUEST COMPLETE", line, stage > 99) line(player,"%%QUEST COMPLETE!&&", line, stage > 99)
} }
} }
companion object { companion object {
@@ -1,7 +1,6 @@
package content.region.kandarin.quest.tree package content.region.kandarin.quest.tree
import core.api.* import core.api.*
import core.game.node.entity.impl.ForceMovement
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import content.global.skill.agility.AgilityHandler import content.global.skill.agility.AgilityHandler
@@ -133,7 +132,7 @@ class TreeGnomeVillageListeners : InteractionListener {
val climbAnimation = Animation(839) val climbAnimation = Animation(839)
val wallLoc = Location(2509,3253,0) val wallLoc = Location(2509,3253,0)
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
if(questStage(player!!, TreeGnomeVillage.questName) > 30){ if(getQuestStage(player!!, TreeGnomeVillage.questName) > 30){
val northSouth = if (player!!.location.y <= wallLoc.y) Direction.NORTH else Direction.SOUTH val northSouth = if (player!!.location.y <= wallLoc.y) Direction.NORTH else Direction.SOUTH
when(stage){ when(stage){
0 -> sendDialogue(player!!,"The wall has been reduced to rubble. It should be possible to climb over the remains").also{ stage++ } 0 -> sendDialogue(player!!,"The wall has been reduced to rubble. It should be possible to climb over the remains").also{ stage++ }
@@ -17,7 +17,6 @@ import content.region.kandarin.seers.quest.elementalworkshop.EWUtils.currentStag
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.interaction.IntType import core.game.interaction.IntType
import core.tools.Log import core.tools.Log
import core.tools.SystemLogger
/** /**
* Listeners for the Elemental Workshop I quest * Listeners for the Elemental Workshop I quest
@@ -179,7 +178,7 @@ class EWListeners : InteractionListener {
return@on true return@on true
} }
// Increment quest stage // Increment quest stage
if (questStage(player, "Elemental Workshop I") < 5) { if (getQuestStage(player, "Elemental Workshop I") < 5) {
setQuestStage(player, "Elemental Workshop I", 5) setQuestStage(player, "Elemental Workshop I", 5)
} }
// Allow player through the wall // Allow player through the wall
@@ -86,7 +86,7 @@ class ElementalWorkshopQuest : Quest("Elemental Workshop I", 52, 51, 1), Command
line(player, "---After fixing up the old workshop machinery, collecting ore", line++) line(player, "---After fixing up the old workshop machinery, collecting ore", line++)
line(player, "---and smelting it I was able to create an Elemental Shield./--", line++) line(player, "---and smelting it I was able to create an Elemental Shield./--", line++)
line++ line++
line(player, "!!QUEST COMPLETE!??", line++) line(player, "%%QUEST COMPLETE!&&", line++)
} }
} }
} }
@@ -8,14 +8,13 @@ import core.game.global.action.DropListener
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.entity.impl.ForceMovement import core.game.node.entity.impl.ForceMovement
import org.rs09.consts.Items import org.rs09.consts.Items
import org.rs09.consts.NPCs
class MerlinListeners : InteractionListener { class MerlinListeners : InteractionListener {
private val BONE_DROP_LOCATION = Location(2780, 3515, 0) private val BONE_DROP_LOCATION = Location(2780, 3515, 0)
override fun defineListeners() { override fun defineListeners() {
on (Items.BAT_BONES_530, IntType.ITEM, "drop") { player, node -> on (Items.BAT_BONES_530, IntType.ITEM, "drop") { player, node ->
val merlinStage = questStage(player, "Merlin's Crystal") val merlinStage = getQuestStage(player, "Merlin's Crystal")
var doingQuest = player.location == BONE_DROP_LOCATION && merlinStage == 80 var doingQuest = player.location == BONE_DROP_LOCATION && merlinStage == 80
var hasAuxiliaryRequirements = inInventory(player, Items.LIT_BLACK_CANDLE_32) && getAttribute<NPC?>(player, "thrantax_npc", null) == null var hasAuxiliaryRequirements = inInventory(player, Items.LIT_BLACK_CANDLE_32) && getAttribute<NPC?>(player, "thrantax_npc", null) == null
@@ -83,7 +83,7 @@ class LostTribe : Quest("Lost Tribe",84,83,1) {
line(player,"the cave goblins. I should do so at once!",line++,stage >= 51) line(player,"the cave goblins. I should do so at once!",line++,stage >= 51)
} }
if(stage >= 100){ if(stage >= 100){
line(player,"!!QUEST COMPLETE!??",line++) line(player,"%%QUEST COMPLETE!&&",line++)
} }
} }
@@ -20,8 +20,8 @@ class FredTheFarmerDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any): Boolean { override fun open(vararg args: Any): Boolean {
npc = args[0] as NPC npc = args[0] as NPC
if (questStage(player, "Sheep Shearer") in 1..99) { if (getQuestStage(player, "Sheep Shearer") in 1..99) {
openDialogue(player, SSFredTheFarmerDialogue(questStage(player, "Sheep Shearer")), npc) openDialogue(player, SSFredTheFarmerDialogue(getQuestStage(player, "Sheep Shearer")), npc)
} else { } else {
npc(FacialExpression.ANGRY, "What are you doing on my land? You're not the one", "who keeps leaving all my gates open and letting out all", "my sheep are you?").also { stage = START_DIALOGUE } npc(FacialExpression.ANGRY, "What are you doing on my land? You're not the one", "who keeps leaving all my gates open and letting out all", "my sheep are you?").also { stage = START_DIALOGUE }
} }
@@ -31,7 +31,7 @@ class FredTheFarmerDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean { override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) { when (stage) {
START_DIALOGUE -> showTopics( START_DIALOGUE -> showTopics(
IfTopic(FacialExpression.NEUTRAL, "I'm looking for a quest.", 1000, questStage(player!!, "Sheep Shearer") == 0), IfTopic(FacialExpression.NEUTRAL, "I'm looking for a quest.", 1000, getQuestStage(player!!, "Sheep Shearer") == 0),
Topic(FacialExpression.HALF_GUILTY, "I'm looking for something to kill.", 100), Topic(FacialExpression.HALF_GUILTY, "I'm looking for something to kill.", 100),
Topic(FacialExpression.HALF_GUILTY, "I'm lost.", 200) Topic(FacialExpression.HALF_GUILTY, "I'm lost.", 200)
) )
@@ -40,7 +40,7 @@ class FredTheFarmerDialogue(player: Player? = null) : DialoguePlugin(player) {
200 -> npc(FacialExpression.HALF_GUILTY, "How can you be lost? Just follow the road east and", "south. You'll end up in Lumbridge fairly quickly.").also { stage = END_DIALOGUE } 200 -> npc(FacialExpression.HALF_GUILTY, "How can you be lost? Just follow the road east and", "south. You'll end up in Lumbridge fairly quickly.").also { stage = END_DIALOGUE }
1000 -> openDialogue(player, SSFredTheFarmerDialogue(questStage(player, "Sheep Shearer")), npc) 1000 -> openDialogue(player, SSFredTheFarmerDialogue(getQuestStage(player, "Sheep Shearer")), npc)
} }
return true return true
} }
@@ -3,7 +3,7 @@ package content.region.misthalin.lumbridge.diary
import content.global.skill.magic.TeleportMethod import content.global.skill.magic.TeleportMethod
import content.global.skill.magic.spellconsts.Modern import content.global.skill.magic.spellconsts.Modern
import core.api.inBorders import core.api.inBorders
import core.api.questStage import core.api.getQuestStage
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import core.game.node.entity.player.link.diary.DiaryType import core.game.node.entity.player.link.diary.DiaryType
@@ -346,7 +346,7 @@ class LumbridgeAchivementDiary : DiaryEventHookBase(DiaryType.LUMBRIDGE) {
override fun onDialogueOptionSelected(player: Player, event: DialogueOptionSelectionEvent) { override fun onDialogueOptionSelected(player: Player, event: DialogueOptionSelectionEvent) {
when (event.dialogue) { when (event.dialogue) {
is DukeHoracioDSDialogue -> { is DukeHoracioDSDialogue -> {
val dragonSlayerStage = questStage(player, "Dragon Slayer") val dragonSlayerStage = getQuestStage(player, "Dragon Slayer")
if ((dragonSlayerStage == 100 && event.currentStage == 4) if ((dragonSlayerStage == 100 && event.currentStage == 4)
|| event.currentStage == 12) { || event.currentStage == 12) {
@@ -7,7 +7,7 @@ import core.game.world.map.Location
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import org.rs09.consts.Scenery as Sceneries import org.rs09.consts.Scenery as Sceneries
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.api.questStage import core.api.getQuestStage
import core.api.sendMessage import core.api.sendMessage
import core.game.interaction.IntType import core.game.interaction.IntType
@@ -16,7 +16,7 @@ class DramenTreeListener : InteractionListener {
override fun defineListeners() { override fun defineListeners() {
on(Sceneries.DRAMEN_TREE_1292, IntType.SCENERY, "chop down"){ player, node -> on(Sceneries.DRAMEN_TREE_1292, IntType.SCENERY, "chop down"){ player, node ->
val questStage = questStage(player,"Lost City") val questStage = getQuestStage(player,"Lost City")
if (SkillingTool.getHatchet(player) == null) { if (SkillingTool.getHatchet(player) == null) {
sendMessage(player,"You do not have an axe which you have the level to use.") sendMessage(player,"You do not have an axe which you have the level to use.")
return@on true return@on true
@@ -28,7 +28,7 @@ class LostCityListeners : InteractionListener {
core.game.global.action.DoorActionHandler.handleAutowalkDoor(player,node as Scenery) core.game.global.action.DoorActionHandler.handleAutowalkDoor(player,node as Scenery)
val quest = "Lost City" val quest = "Lost City"
val isOutsideShed = player.location.x < node.location.x val isOutsideShed = player.location.x < node.location.x
val canDramenTeleport = inEquipment(player,Items.DRAMEN_STAFF_772) && ( questStage(player,quest) > 20 ) && isOutsideShed val canDramenTeleport = inEquipment(player,Items.DRAMEN_STAFF_772) && ( getQuestStage(player,quest) > 20 ) && isOutsideShed
if(canDramenTeleport) { if(canDramenTeleport) {
var count = 0 var count = 0
// pulser to handle the teleport. after 2 ticks it checks if the player hasnt completed lost city; if so, then it finishes the quest after the teleport // pulser to handle the teleport. after 2 ticks it checks if the player hasnt completed lost city; if so, then it finishes the quest after the teleport
@@ -1,11 +1,9 @@
package content.region.misthalin.lumbridge.quest.lostcity package content.region.misthalin.lumbridge.quest.lostcity
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import core.plugin.Initializable import core.plugin.Initializable
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import core.api.questStage import core.api.getQuestStage
import core.api.setQuestStage import core.api.setQuestStage
/** /**
@@ -25,7 +23,7 @@ class ShamusDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin
} }
override fun handle(interfaceId: Int, buttonId: Int): Boolean { override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when(questStage(player,quest)) { when(getQuestStage(player,quest)) {
0 -> when(stage++) { 0 -> when(stage++) {
0 -> playerl(core.game.dialogue.FacialExpression.THINKING, "I'm not sure.") 0 -> playerl(core.game.dialogue.FacialExpression.THINKING, "I'm not sure.")
1 -> npcl(core.game.dialogue.FacialExpression.ANNOYED,"Well you'll have to be catchin' me again when yer are, elephant!") 1 -> npcl(core.game.dialogue.FacialExpression.ANNOYED,"Well you'll have to be catchin' me again when yer are, elephant!")
@@ -7,7 +7,7 @@ import core.game.node.entity.player.Player
import core.game.world.map.Location import core.game.world.map.Location
import core.plugin.Initializable import core.plugin.Initializable
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import core.api.questStage import core.api.getQuestStage
import core.api.sendDialogue import core.api.sendDialogue
import core.api.setQuestStage import core.api.setQuestStage
@@ -48,7 +48,7 @@ class TreeSpiritNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, l
super.finalizeDeath(killer) super.finalizeDeath(killer)
if (killer is Player) { if (killer is Player) {
val quest = "Lost City" val quest = "Lost City"
if (questStage(killer,quest) == 20) { if (getQuestStage(killer,quest) == 20) {
setQuestStage(killer,quest,21) setQuestStage(killer,quest,21)
sendDialogue(killer, "With the Tree Spirit defeated you can now chop the tree.") sendDialogue(killer, "With the Tree Spirit defeated you can now chop the tree.")
} }
@@ -1,13 +1,11 @@
package content.region.misthalin.lumbridge.quest.lostcity package content.region.misthalin.lumbridge.quest.lostcity
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import core.plugin.Initializable import core.plugin.Initializable
import org.rs09.consts.NPCs import org.rs09.consts.NPCs
import core.game.dialogue.Topic import core.game.dialogue.Topic
import core.tools.END_DIALOGUE import core.tools.END_DIALOGUE
import core.api.questStage import core.api.getQuestStage
import core.api.startQuest import core.api.startQuest
/** /**
@@ -19,7 +17,7 @@ import core.api.startQuest
class WarriorDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) { class WarriorDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean { override fun open(vararg args: Any?): Boolean {
when(questStage(player,"Lost City")) { when(getQuestStage(player,"Lost City")) {
10 -> playerl(core.game.dialogue.FacialExpression.THINKING,"So let me get this straight: I need to search the trees around here for a leprechaun; and then when I find him, he will tell me where this 'Zanaris' is?").also { stage = 1000 } 10 -> playerl(core.game.dialogue.FacialExpression.THINKING,"So let me get this straight: I need to search the trees around here for a leprechaun; and then when I find him, he will tell me where this 'Zanaris' is?").also { stage = 1000 }
20, 21 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Have you found anything yet?").also { stage = 2000 } 20, 21 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Have you found anything yet?").also { stage = 2000 }
100 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Hey, thanks for all the information. It REALLY helped me out in finding the lost city of Zanaris and all.").also { stage = 3000 } 100 -> playerl(core.game.dialogue.FacialExpression.HAPPY,"Hey, thanks for all the information. It REALLY helped me out in finding the lost city of Zanaris and all.").also { stage = 3000 }
@@ -4,7 +4,7 @@ import content.global.skill.agility.AgilityHandler
import content.region.misthalin.lumbridge.dialogue.DukeHoracioDialogue import content.region.misthalin.lumbridge.dialogue.DukeHoracioDialogue
import core.api.Event import core.api.Event
import core.api.LoginListener import core.api.LoginListener
import core.api.questStage import core.api.getQuestStage
import core.game.component.Component import core.game.component.Component
import core.game.event.EventHook import core.game.event.EventHook
import core.game.event.PickUpEvent import core.game.event.PickUpEvent
@@ -323,7 +323,7 @@ class DragonSlayer : Quest("Dragon Slayer", 18, 17, 2, 176, 0, 1, 10), LoginList
} }
override fun login(player: Player) { override fun login(player: Player) {
if (questStage(player, this.name) == 20) { if (getQuestStage(player, this.name) == 20) {
player.hook(Event.SpellCast, SpellCastHook) player.hook(Event.SpellCast, SpellCastHook)
player.hook(Event.PickedUp, PickedUpHook) player.hook(Event.PickedUp, PickedUpHook)
} }
@@ -2,7 +2,6 @@ package content.region.misthalin.varrock.quest.familycrest
import core.api.* import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.node.entity.npc.NPC import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player import core.game.node.entity.player.Player
import core.plugin.Initializable import core.plugin.Initializable
@@ -23,7 +22,7 @@ class DimintheisDialogue(player: Player? = null): core.game.dialogue.DialoguePlu
override fun open(vararg args: Any?): Boolean { override fun open(vararg args: Any?): Boolean {
npc = (args[0] as NPC).getShownNPC(player) npc = (args[0] as NPC).getShownNPC(player)
val questStage = questStage(player, questName) val questStage = getQuestStage(player, questName)
val questComplete = isQuestComplete(player, questName) val questComplete = isQuestComplete(player, questName)
if (questStage == 20 && inInventory(player, Items.FAMILY_CREST_782)) { if (questStage == 20 && inInventory(player, Items.FAMILY_CREST_782)) {
@@ -88,7 +88,7 @@ class FamilyCrest: Quest("Family Crest", 59, 58, 1, 148, 0, 1, 11) {
line(player, "and would always return to !!Dimintheis??", line++) line(player, "and would always return to !!Dimintheis??", line++)
line(player, "for me to reclaim if I ever lost them.", line++) line(player, "for me to reclaim if I ever lost them.", line++)
line++ line++
line(player, "!!QUEST COMPLETE!??.", line++) line(player, "%%QUEST COMPLETE!&&.", line++)
} }
@@ -14,7 +14,7 @@ class JohnathonAntiPosionInteraction: InteractionListener {
onUseWith(IntType.NPC, poisons, NPCs.JOHNATHON_668){ player, used, with -> onUseWith(IntType.NPC, poisons, NPCs.JOHNATHON_668){ player, used, with ->
val npc = with.asNpc() val npc = with.asNpc()
val antip = used.asItem() val antip = used.asItem()
val stage = questStage(player, "Family Crest") val stage = getQuestStage(player, "Family Crest")
val index = poisons.indexOf(used.id) val index = poisons.indexOf(used.id)
val returnItem = if(index + 1 == poisons.size) Items.VIAL_229 else poisons[index + 1] val returnItem = if(index + 1 == poisons.size) Items.VIAL_229 else poisons[index + 1]
@@ -100,7 +100,7 @@ class NatureSpiritQuest : Quest("Nature Spirit", 95, 94, 2, 307, 0, 1, 110 ) {
} }
if(stage >= 100){ if(stage >= 100){
line(player,"!!QUEST COMPLETE!??",line++) line(player,"%%QUEST COMPLETE!&&",line++)
} }
} }
} }
+15 -3
View File
@@ -66,6 +66,7 @@ import core.game.world.repository.Repository
import core.game.consumable.* import core.game.consumable.*
import core.ServerConstants import core.ServerConstants
import core.api.utils.Vector import core.api.utils.Vector
import core.game.node.entity.player.link.quest.Quest
import core.tools.* import core.tools.*
import core.game.world.update.flag.* import core.game.world.update.flag.*
import core.game.world.update.flag.context.* import core.game.world.update.flag.context.*
@@ -1478,6 +1479,18 @@ fun sendItemOnInterface(player: Player, iface: Int, child: Int, item: Int, amoun
player.packetDispatch.sendItemOnInterface(item, amount, iface, child) player.packetDispatch.sendItemOnInterface(item, amount, iface, child)
} }
/**
* Sends a zoomed item to a specific child on an interface
* @param player the player to send the packet to
* @param iface the ID of the interface to send the item onto
* @Param child the index of the child on the interface to send the item onto
* @param item the ID of the item to send
* @param zoom the amount of zoom to apply to the item - defaults to 230
*/
fun sendItemZoomOnInterface(player: Player, iface: Int, child: Int, item: Int, zoom: Int = 230) {
player.packetDispatch.sendItemZoomOnInterface(item, zoom, iface, child)
}
/** /**
* Sends a dialogue box with a single item and some text * Sends a dialogue box with a single item and some text
* @param player the player to send it to * @param player the player to send it to
@@ -1588,14 +1601,14 @@ fun runTask(entity: Entity, delay: Int = 0, repeatTimes: Int = 1, task: () -> Un
* @param player the player to get the QP for * @param player the player to get the QP for
* @return the number of QP the player has * @return the number of QP the player has
*/ */
fun getQP(player: Player): Int { fun getQuestPoints(player: Player): Int {
return player.questRepository.points return player.questRepository.points
} }
/** /**
* Gets the stage for the given quest for the given player * Gets the stage for the given quest for the given player
*/ */
fun questStage(player: Player, quest: String): Int { fun getQuestStage(player: Player, quest: String): Int {
return player.questRepository.getStage(quest) return player.questRepository.getStage(quest)
} }
@@ -1621,7 +1634,6 @@ fun isQuestComplete(player: Player, quest: String): Boolean {
return player.questRepository.getStage(quest) == 100 return player.questRepository.getStage(quest) == 100
} }
/** /**
* Check if a player meets the requirements to start a quest, and then starts it if they do. Returns success bool * Check if a player meets the requirements to start a quest, and then starts it if they do. Returns success bool
*/ */
@@ -21,6 +21,11 @@ public abstract class Quest implements Plugin<Object> {
*/ */
public static final String RED = "<col=8A0808>"; public static final String RED = "<col=8A0808>";
/**
* Represents the bright red string.
*/
public static final String BRIGHT_RED = "<col=FF0000>";
/** /**
* Represents the blue string. * Represents the blue string.
*/ */
@@ -151,7 +156,7 @@ public abstract class Quest implements Plugin<Object> {
line++; line++;
} }
} else { } else {
send = send.replace("!!",RED).replace("??",BLUE).replace("---",BLACK + "<str>").replace("/--", BLUE); send = send.replace("!!", RED).replace("??", BLUE).replace("---", BLACK + "<str>").replace("/--", BLUE).replace("%%", BRIGHT_RED).replace("&&", BLUE);
line(player, send, line, false); line(player, send, line, false);
} }
} }
@@ -164,12 +169,13 @@ public abstract class Quest implements Plugin<Object> {
* @param crossed True if the message should be crossed out. * @param crossed True if the message should be crossed out.
*/ */
public void line(Player player, String message, int line, final boolean crossed) { public void line(Player player, String message, int line, final boolean crossed) {
String send = message; String send;
if(!crossed){ if(!crossed){
send = BLUE + "" + message.replace("<n>", "<br><br>").replace("<blue>", BLUE).replace("<red>", RED); send = BLUE + "" + message.replace("<n>", "<br><br>").replace("<blue>", BLUE).replace("<red>", RED);
send = send.replace("!!",RED).replace("??",BLUE); send = send.replace("!!", RED).replace("??", BLUE).replace("%%", BRIGHT_RED).replace("&&", BLUE);
} else { } else {
send = BLUE + "" + message.replace("??","").replace("!!",""); send = BLACK + "" + message.replace("<n>", "<br><br>").replace("<blue>", "").replace("<red>", "RED");
send = send.replace("!!", "").replace("??", "").replace("%%", "").replace("&&", "");
} }
player.getPacketDispatch().sendString(crossed ? "<str>" + send + "</str>" : send, JOURNAL_COMPONENT, line); player.getPacketDispatch().sendString(crossed ? "<str>" + send + "</str>" : send, JOURNAL_COMPONENT, line);
} }
+1 -2
View File
@@ -14,7 +14,6 @@ import core.ServerConstants
import core.game.interaction.InteractionListener import core.game.interaction.InteractionListener
import core.game.interaction.IntType import core.game.interaction.IntType
import core.game.interaction.InterfaceListener import core.game.interaction.InterfaceListener
import core.tools.SystemLogger
import core.game.system.command.Privilege import core.game.system.command.Privilege
import java.io.FileReader import java.io.FileReader
import core.tools.* import core.tools.*
@@ -138,7 +137,7 @@ class Shops : StartupListener, TickListener, InteractionListener, InterfaceListe
} }
on(NPCs.SIEGFRIED_ERKLE_933, IntType.NPC, "trade"){ player, node -> on(NPCs.SIEGFRIED_ERKLE_933, IntType.NPC, "trade"){ player, node ->
val points = getQP(player) val points = getQuestPoints(player)
if(points < 40){ if(points < 40){
sendNPCDialogue(player, NPCs.SIEGFRIED_ERKLE_933, "I'm sorry, adventurer, but you need 40 quest points to buy from me.") sendNPCDialogue(player, NPCs.SIEGFRIED_ERKLE_933, "I'm sorry, adventurer, but you need 40 quest points to buy from me.")
return@on true return@on true