Fight Arena Bug Fixes

Fixed HD related issues during hengrad cutscene
Fixed dialogue after entering the hengrad cell
Fixed doors that were not visually open when opened by the bouncer in the cutscene
Refactored guard dialogue
Fixed some exceptions
This commit is contained in:
szumaster
2023-03-02 12:42:29 +00:00
committed by Ryan
parent c42daa5dba
commit 35e1477c24
27 changed files with 221 additions and 397 deletions
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.npcs.enemies.BouncerNPC.Companion.spawnBouncer
import content.region.kandarin.ardougne.quest.arena.BouncerNPC.Companion.spawnBouncer
import core.api.getScenery
import core.api.location
import core.api.replaceScenery
@@ -27,8 +27,6 @@ class BouncerCutscene(player: Player) : Cutscene(player) {
override fun runStage(stage: Int) {
when (stage) {
// ------------------ Settings ------------------
0 -> {
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 1))
loadRegion(10289)
@@ -37,43 +35,43 @@ class BouncerCutscene(player: Player) : Cutscene(player) {
timedUpdate(1)
}
// ---------------- Bouncer zoom ----------------
1 -> {
moveCamera(43, 27)
moveCamera(42, 27)
rotateCamera(46, 27)
replaceScenery(Scenery(77, location(174, 26, 0)), PRISON_DOOR_79, 4)
replaceScenery(Scenery(78, location(174, 27, 0)), PRISON_DOOR_80, 4)
timedUpdate(1)
timedUpdate(2)
}
2 -> {
DoorActionHandler.handleAutowalkDoor(getNPC(BOUNCER)!!, getScenery(174, 27, 0))
DoorActionHandler.handleAutowalkDoor(getNPC(BOUNCER)!!, getScenery(174, 26, 0))
replaceScenery(Scenery(77, location(302, 26, 0)), PRISON_DOOR_79, 8)
replaceScenery(Scenery(78, location(302, 27, 0)), PRISON_DOOR_80, 8)
timedUpdate(1)
}
3 -> {
DoorActionHandler.handleAutowalkDoor(getNPC(BOUNCER)!!, getScenery(302, 27, 0))
DoorActionHandler.handleAutowalkDoor(getNPC(BOUNCER)!!, getScenery(302, 26, 0))
timedUpdate(2)
}
4 -> {
move(getNPC(BOUNCER)!!, 45, 26)
moveCamera(39, 27, 300, 1)
rotateCamera(44, 27, 300, 1)
timedUpdate(1)
}
4 -> {
5 -> {
move(getNPC(BOUNCER)!!, 44, 26)
timedUpdate(1)
}
5 -> {
6 -> {
move(getNPC(BOUNCER)!!, 42, 26)
timedUpdate(-1)
}
// --------------- End & Spawn bouncer ---------------
6 -> {
7 -> {
end {
spawnBouncer(player)
}
@@ -1,7 +1,5 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import content.region.kandarin.ardougne.quest.fightarena.npcs.GeneralKhazardDialogue
import core.api.*
import core.game.node.entity.Entity
import core.game.node.entity.npc.AbstractNPC
@@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.quest.fightarena
package content.region.kandarin.ardougne.quest.arena
import core.api.addItemOrDrop
import core.api.rewardXP
@@ -10,11 +10,6 @@ import org.rs09.consts.Items.COINS_995
@Initializable
class FightArena : Quest("Fight Arena", 61, 60, 2, 17, 0, 1, 14) {
//------------------------------------------------------------
// Version: 1.0.3
// Source: https://runescape.wiki/w/Fight_Arena?oldid=1360259
// ------------------------------------------------------------
override fun newInstance(`object`: Any?): Quest { return this }
companion object { const val FightArenaQuest = "Fight Arena" }
override fun drawJournal(player: Player?, stage: Int) {
@@ -1,7 +1,5 @@
package content.region.kandarin.ardougne.quest.fightarena
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.npcs.*
import content.region.kandarin.ardougne.quest.fightarena.npcs.enemies.GeneralNPC
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@@ -33,19 +31,12 @@ class FightArenaListeners : InteractionListener {
const val MAINDOORS = Scenery.DOOR_81
const val CENTERDOOR = Scenery.DOOR_82
const val LAZYGUARD = Scenery.A_LAZY_KHAZARD_GUARD_41494
const val ARMOR_ONLY_ARMOR_STAND = Scenery.A_SUIT_OF_ARMOUR_41506
const val HELM_ONLY_ARMOR_STAND = Scenery.A_SUIT_OF_ARMOUR_41507
const val EMPTY_ARMOR_STAND = Scenery.A_SUIT_OF_ARMOUR_41508
const val FULL_ARMOR_STAND = Scenery.A_SUIT_OF_ARMOUR_41490
private const val HELMET = Items.KHAZARD_HELMET_74
private const val ARMOUR = Items.KHAZARD_ARMOUR_75
private const val CELLKEY = Items.KHAZARD_CELL_KEYS_76
//-----------------------------------------------------------------------------------------------------
val Jeremy = NPC(NPCs.JEREMY_SERVIL_265, Location.create(2616,3167,0))
val General = GeneralNPC(NPCs.GENERAL_KHAZARD_258, Location.create(2605,3156,0))
}
@@ -60,8 +51,6 @@ class FightArenaListeners : InteractionListener {
override fun defineListeners() {
//------------------------- Npcs -------------------------
on(GENERAL, IntType.NPC, "talk-to") { player, npc ->
openDialogue(player, GeneralKhazardDialogue(), npc)
return@on true
@@ -102,10 +91,6 @@ class FightArenaListeners : InteractionListener {
return@on true
}
//------------------------- Objects -------------------------
// Steal Khazard set from suit of Armour.
on(FULL_ARMOR_STAND, IntType.SCENERY, "borrow") { player, _ ->
if (player.questRepository.getStage("Fight Arena") == 10 && player.inventory.containItems(HELMET) && player.inventory.containItems(ARMOUR)) {
sendMessage(player, "Nothing interesting happens.")
@@ -126,9 +111,6 @@ class FightArenaListeners : InteractionListener {
}
}
// Doors leading to the prison.
// Source: https://youtu.be/-wV5dIyM0YM?t=60
on(MAINDOORS, IntType.SCENERY, "open") { player, maingate ->
when (player.location.y) {
3171 -> DoorActionHandler.handleAutowalkDoor(player, maingate.asScenery())
@@ -155,9 +137,8 @@ class FightArenaListeners : InteractionListener {
return@on true
}
// Using key on cell door to freeing Jeremy.
onUseWith(IntType.SCENERY, CELLKEY, JEREMYPRISONDOOR) { player, _, _ ->
if (player.inventory.containsAtLeastOneItem(CELLKEY) && player.questRepository.getStage("Fight Arena") == 68 || player.questRepository.getStage("Fight Arena") == 88) {
if (player.inventory.containsAtLeastOneItem(CELLKEY) && player.questRepository.getStage("Fight Arena") in 68..89) {
openDialogue(player, JeremyServilDialogue())
} else {
sendMessage(player, "The cell gate is securely locked.")
@@ -166,8 +147,6 @@ class FightArenaListeners : InteractionListener {
return@onUseWith true
}
// Using key on other cell doors.
onUseWith(IntType.SCENERY, CELLKEY, OTHERPRISONDOORS) { player, _, _ ->
if (player.inventory.containsAtLeastOneItem(CELLKEY) && player.questRepository.getStage("Fight Arena") in 68..72) {
sendPlayerDialogue(player, "I don't want to attract too much attention by freeing all the prisoners. I need to find Jeremy and he's not in this cell.")
@@ -177,21 +156,16 @@ class FightArenaListeners : InteractionListener {
return@onUseWith false
}
// Doors to rest of the cell.
on(OTHERPRISONDOORS, IntType.SCENERY, "open") { player, _ ->
sendMessage(player, "the cell gate is securely locked.")
return@on false
}
// Block Jeremy doors.
on(JEREMYPRISONDOOR, IntType.SCENERY, "open") { player, _ ->
sendMessage(player, "the cell gate is securely locked.")
return@on false
}
// Exit arena.
on(CENTERDOOR, IntType.SCENERY, "open") { player, centerdoor ->
if (player.questRepository.getStage("Fight Arena") >= 91) {
DoorActionHandler.handleAutowalkDoor(player, centerdoor.asScenery())
@@ -208,39 +182,32 @@ class FightArenaListeners : InteractionListener {
override fun defineDestinationOverrides() {
//---------------------- Improvements ----------------------
// Access to talk with Jeremy through the prison bars.
setDest(IntType.NPC, intArrayOf(JEREMY), "talk-to") { _, _ ->
return@setDest Location.create(2617, 3167, 0)
}
// Access to talk Khazard barman through counter at the bar.
setDest(IntType.NPC, intArrayOf(BARMAN), "talk-to") { _, _ ->
return@setDest Location.create(2566, 3142, 0)
}
// Access to talk Fightslave through the prison bars.
setDest(IntType.NPC, intArrayOf(FIGHTSLAVE), "talk-to") { _, _ ->
return@setDest Location.create(2617, 3162, 0).transform(0, 1, 0)
}
// Access to talk Kelvin through the prison bars.
setDest(IntType.NPC, intArrayOf(KELVIN), "talk-to") { _, _ ->
return@setDest Location.create(2589, 3141, 0)
}
// Access to talk Joe through the prison bars.
setDest(IntType.NPC, intArrayOf(JOE), "talk-to") { _, _ ->
return@setDest Location.create(2589, 3141, 0)
}
setDest(IntType.NPC, intArrayOf(HENGARD), "talk-to") { _, _ ->
return@setDest Location.create(2600, 3142, 0)
}
//------------------------- Dialogue support -------------------------
}
// Support for prison doors.
// Source: https://youtu.be/dCJhnLk1vMk?t=145
class EastDoorSupportDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.KHAZARD_GUARD_257)
@@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.prisoners
package content.region.kandarin.ardougne.quest.arena
import core.api.isEquipped
import core.game.dialogue.DialoguePlugin
@@ -12,9 +12,6 @@ import org.rs09.consts.NPCs
@Initializable
class FightslaveDialogue(player: Player? = null) : DialoguePlugin(player) {
// Fightslave - NPC inside prison cell.
// Source: https://runescape.wiki/w/Slave_fighter?oldid=2632974
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
@@ -1,9 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import content.region.kandarin.ardougne.quest.fightarena.FightArenaListeners.Companion.General
import content.region.kandarin.ardougne.quest.fightarena.cutscenes.BouncerCutscene
import content.region.kandarin.ardougne.quest.fightarena.cutscenes.HengradCutscene
import content.region.kandarin.ardougne.quest.arena.FightArenaListeners.Companion.General
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@@ -13,17 +10,14 @@ import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs.GENERAL_KHAZARD_258
class GeneralKhazardDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = NPC(GENERAL_KHAZARD_258)
when {
// Talking to General Khazard during first fight.
(questStage == 71) -> {
when (stage) {
0 -> if (!isEquipped(player!!, 74) && !isEquipped(player!!, 75)) {
@@ -40,7 +34,6 @@ class GeneralKhazardDialogue : DialogueFile() {
}
}
// Talking to General Khazard after first fight.
(questStage == 72) -> {
when (stage) {
0 -> lockInteractions(player!!, 2).also { sendNPCDialogue(player!!, 267,"You saved my life and my son's, I am eternally in your debt brave traveller.") }.also{ player!!.faceLocation(location(2601,3168,0)) }.also{ stage = 1 }
@@ -58,7 +51,6 @@ class GeneralKhazardDialogue : DialogueFile() {
}
}
// Talking to General Khazard during the scorpion fight.
(questStage <= 87) -> {
when (stage) {
0 -> npcl(FacialExpression.ANGRY, "How dare you speak to me, you are a slave of this arena now.").also { stage = END_DIALOGUE }
@@ -75,7 +67,6 @@ class GeneralKhazardDialogue : DialogueFile() {
}
}
// Talking to General Khazard after the scorpion fight.
(questStage == 89) -> {
when (stage) {
0 -> lockInteractions(player!!, 2).also{ npcl(FacialExpression.ANNOYED, "Not bad, not bad at all. I think you need a tougher challenge. Time for my puppy. Guards! Guards! Bring on Bouncer!") }.also { player!!.faceLocation(npc!!.location) }.also { stage = 1 }
@@ -88,7 +79,6 @@ class GeneralKhazardDialogue : DialogueFile() {
}
}
// Talking to General Khazard after killing bouncer.
(questStage == 91) -> {
when (stage) {
0 -> lockInteractions(player!!,4).also { npcl(FacialExpression.SAD, "Nooooo! Bouncer! How dare you? You've taken the life of my old friend. Now you'll suffer traveller, prepare to meet your maker.") }.also { player!!.faceLocation(npc!!.location) }.also { stage = 1 }
@@ -1,9 +1,7 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import content.region.kandarin.ardougne.quest.fightarena.FightArenaListeners.Companion.General
import content.region.kandarin.ardougne.quest.fightarena.npcs.JeremyServilRescuedDialogue
import content.region.kandarin.ardougne.quest.arena.FightArenaListeners.Companion.General
import core.api.openDialogue
import core.api.questStage
import core.api.setQuestStage
@@ -0,0 +1,154 @@
package content.region.kandarin.ardougne.quest.arena
import core.api.isEquipped
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class GuardsDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 2 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.ASKING, "Can I help you stranger?").also { stage = 1 }
1 -> npcl(FacialExpression.FRIENDLY, "Oh, you're a guard as well. That's ok then. We don't like strangers around here").also { stage = END_DIALOGUE }
}
when (stage) {
2 -> npcl(FacialExpression.ANNOYED, "I don't know you stranger. Get off our land.").also { stage = END_DIALOGUE
}
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return GuardsDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_253)
}
}
@Initializable
class KhazardGuard254Dialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 7 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "I've never seen you around here before!").also { stage = 1 }
1 -> playerl(FacialExpression.FRIENDLY, "Long live General Khazard!").also { stage = 2 }
2 -> npcl(FacialExpression.FRIENDLY, "Erm.. yes.. soldier, I take it you're new around here?").also { stage = 3 }
3 -> playerl(FacialExpression.FRIENDLY, "You could say that.").also { stage = 4 }
4 -> npcl(FacialExpression.FRIENDLY, "Khazard died two hundred years ago. However his dark spirit remains in the form of the undead maniac General Khazard. Remember he is your master, always watching.").also { stage = 5 }
5 -> npcl(FacialExpression.FRIENDLY, "Got that newbie?").also { stage = 6 }
6 -> playerl(FacialExpression.FRIENDLY, "Undead, maniac, master. Got it, loud and clear.").also { stage = END_DIALOGUE
}
}
when (stage) {
7 -> npcl(FacialExpression.ANNOYED, "This area is restricted, leave now!").also { stage = 8 }
8 -> npcl(FacialExpression.ANGRY, "OUT! And don't come back!").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KhazardGuard254Dialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_254)
}
}
@Initializable
class KhazardGuard255Dialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 2 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.ASKING, "Can I help you stranger?").also { stage = 1 }
1 -> npcl(FacialExpression.FRIENDLY, "Oh, you're a guard as well. That's ok then. We don't like strangers around here.").also { stage = END_DIALOGUE }
}
when (stage) {
2 -> npcl(FacialExpression.ANNOYED, "This area is restricted, leave now!").also { stage = 3 }
3 -> npcl(FacialExpression.ANGRY, "OUT! And don't come back!").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KhazardGuard255Dialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_255)
}
}
@Initializable
class KhazardGuard256Dialogue(player: Player? = null) : DialoguePlugin(player) {
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 3 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.ANGRY, "Despicable thieving scum, that was good armour. Did you see anyone around here soldier?").also { stage = 1 }
1 -> playerl(FacialExpression.SILENT, "Me? No, no one!").also { stage = 2 }
2 -> npcl(FacialExpression.SUSPICIOUS, "Hmmmm").also { stage = END_DIALOGUE }
}
when (stage) {
3 -> npcl(FacialExpression.ANNOYED, "I don't know who you are. Get out of my house stranger.").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KhazardGuard256Dialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_256)
}
}
@@ -1,8 +1,9 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
package content.region.kandarin.ardougne.quest.arena
import core.api.animate
import core.api.getScenery
import core.api.location
import core.api.openDialogue
import core.game.activity.Cutscene
import core.game.component.Component
import core.game.dialogue.FacialExpression
@@ -15,9 +16,6 @@ import core.net.packet.out.MinimapState
import org.rs09.consts.Components
class HengradCutscene(player: Player) : Cutscene(player) {
// Source: https://youtu.be/-wV5dIyM0YM?t=182
// Guard 257 https://youtu.be/V9qqeatAkIA?t=193
override fun setup() {
setExit(location(2600, 3142, 0))
if (player.settings.isRunToggled) {
@@ -28,8 +26,6 @@ class HengradCutscene(player: Player) : Cutscene(player) {
override fun runStage(stage: Int) {
when (stage) {
// ---------- There is no roof to this world ----------
0 -> {
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 1))
addNPC(KHAZARD_GUARD, 48, 5, Direction.WEST)
@@ -38,7 +34,7 @@ class HengradCutscene(player: Player) : Cutscene(player) {
}
1 -> {
moveCamera(45, 4, 400)
moveCamera(43, 4)
rotateCamera(41, 5)
timedUpdate(1)
}
@@ -73,23 +69,18 @@ class HengradCutscene(player: Player) : Cutscene(player) {
7 -> {
dialogueUpdate(257, FacialExpression.FRIENDLY, "The General seems to have taken a liking to you. He'd normally kill imposters like you without a second thought.").also { getNPC(KHAZARD_GUARD)!!.faceLocation(player.location) }
player.faceLocation(getNPC(KHAZARD_GUARD)!!.location)
timedUpdate(4)
timedUpdate(3)
}
8 -> {
player.interfaceManager.openOverlay(Component(Components.FADE_TO_BLACK_120))
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 2))
timedUpdate(-1)
}
// ---------------- End & Hengrad talk ----------------
9 -> {
// Fix camera stuck after cutscene.
loadRegion(10289)
teleport(player, 40, 6)
timedUpdate(-1)
timedUpdate(6)
}
9 -> {
end {
openDialogue(player, HengradDialogue())
}
}
}
@@ -1,8 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import content.region.kandarin.ardougne.quest.fightarena.cutscenes.BouncerCutscene
import content.region.kandarin.ardougne.quest.fightarena.cutscenes.ScorpionCutscene
import core.api.location
import core.api.lockInteractions
import core.api.questStage
import core.api.setQuestStage
@@ -12,21 +10,18 @@ import core.game.node.entity.npc.NPC
import org.rs09.consts.NPCs
class HengradDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = NPC(NPCs.HENGRAD_263)
when (questStage) {
// Talking to Hengrad after cutscene.
72 -> {
when (stage) {
0 -> npcl(FacialExpression.AFRAID, "Are you ok stranger?").also{ lockInteractions(player!!,3) }.also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "I'm fine thanks.").also { player!!.faceLocation(npc!!.location) }.also { stage++ }
0 -> npcl(FacialExpression.AFRAID, "Are you ok stranger?").also{ lockInteractions(player!!,3) }.also { player!!.faceLocation(location(2597, 3143, 0)) }.also { stage++ }
1 -> playerl(FacialExpression.FRIENDLY, "I'm fine thanks.").also { stage++ }
2 -> npcl(FacialExpression.ASKING, " So Khazard got his hand on you too?").also { stage++ }
3 -> playerl(FacialExpression.HALF_WORRIED, " I'm afraid so.").also { stage++ }
4 -> npcl(FacialExpression.FRIENDLY, " If you're lucky you may last as long as me.").also { stage++ }
@@ -37,12 +32,12 @@ class HengradDialogue : DialogueFile() {
9 -> npcl(FacialExpression.SILENT, "Wait... Shhh, the guard is coming. Looks like you'll be going into the arena. Good luck, friend.").also { stage++ }
10 -> {
end()
player!!.unlock()
ScorpionCutscene(player!!).start()
setQuestStage(player!!, FightArena.FightArenaQuest, 88)
}
}
}
88 -> {
when (stage) {
0 -> {
@@ -1,8 +1,7 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena.Companion.FightArenaQuest
import content.region.kandarin.ardougne.quest.fightarena.FightArenaListeners.Companion.Jeremy
import content.region.kandarin.ardougne.quest.fightarena.cutscenes.RescueCutscene
import content.region.kandarin.ardougne.quest.arena.FightArena.Companion.FightArenaQuest
import content.region.kandarin.ardougne.quest.arena.FightArenaListeners.Companion.Jeremy
import core.api.questStage
import core.api.setAttribute
import core.api.setQuestStage
@@ -21,7 +20,6 @@ class JeremyServilDialogue : DialogueFile() {
when {
// Talking to Jeremy before we get the keys.
(questStage == 20) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello").also { npc!!.faceLocation(player!!.location) }.also { player!!.faceLocation(npc!!.location) }.also { stage++ }
@@ -33,8 +31,7 @@ class JeremyServilDialogue : DialogueFile() {
}
}
// Talking to Jeremy after we get the keys.
(questStage in 88 downTo 68) -> {
(questStage in 89 downTo 68) -> {
when (stage) {
0 -> playerl(FacialExpression.NEUTRAL, "Jeremy look, I have the keys.").also { npc!!.faceLocation(player!!.location) }.also { player!!.faceLocation(npc!!.location) }.also { stage++ }
1 -> npcl(FacialExpression.NEUTRAL, "Wow! Please set me free, then we can find my dad. I overheard a guard talking. I think they're taken him to the arena.").also { stage++ }
@@ -47,7 +44,6 @@ class JeremyServilDialogue : DialogueFile() {
}
}
// Talk with Jeremy after complete the quest. Source: https://runescapeclassic.fandom.com/wiki/Jeremy_Servil
(questStage == 100) -> {
when (stage) {
0 -> playerl(FacialExpression.NEUTRAL, "You need to kill the creatures in the arena").also { npc!!.faceLocation(player!!.location) }.also { player!!.faceLocation(npc!!.location) }.also { stage = END_DIALOGUE }
@@ -1,7 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import core.api.lockInteractions
import core.api.questStage
import core.api.sendPlayerDialogue
@@ -18,12 +17,10 @@ class JeremyServilRescuedDialogue : DialogueFile() {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = NPC(NPCs.JEREMY_SERVIL_266)
when (questStage) {
// Talking with Jeremy after first fight.
75 -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Come on Jeremy, we have to get out of here.").also { stage = 1 }
@@ -31,7 +28,6 @@ class JeremyServilRescuedDialogue : DialogueFile() {
}
}
// Talking with Jeremy after second fight.
85 -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Don't worry, I'll get us out of here.").also { stage = 1 }
@@ -39,7 +35,6 @@ class JeremyServilRescuedDialogue : DialogueFile() {
}
}
// Talking with Jeremy after killing bouncer.
97 -> {
when (stage) {
0 -> lockInteractions(player!!,1).also{ playerl(FacialExpression.FRIENDLY, "You and you father can return to Lady Servil.")}.also { stage = 1 }
@@ -51,7 +46,6 @@ class JeremyServilRescuedDialogue : DialogueFile() {
}
}
// Talking with Jeremy after killing general. (Optional fight)
98 -> {
when (stage) {
0 -> sendPlayerDialogue(player!!, "Khazard is dead, you and you father can return to Lady Servil.").also { stage = 1 }
@@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.prisoners
package content.region.kandarin.ardougne.quest.arena
import core.api.isEquipped
import core.api.sendNPCDialogue
@@ -14,8 +14,6 @@ import org.rs09.consts.NPCs
@Initializable
class JoeDialogue(player: Player? = null) : DialoguePlugin(player) {
// Joe - NPC inside prison cell.
// Source: https://runescape.wiki/w/Joe_(Fight_Arena)?oldid=2632949
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
@@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import core.api.questStage
import core.game.dialogue.DialogueFile
@@ -8,17 +8,14 @@ import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
class JustinServilDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = NPC(NPCs.JUSTIN_SERVIL_267)
when {
// Talking to Justin in the arena during the scorpion fight.
(questStage == 88) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Don't worry, I'll get us out of here.").also { stage = 1 }
@@ -26,7 +23,6 @@ class JustinServilDialogue : DialogueFile() {
}
}
// Talking to Justin after saving his life.
(questStage == 100) -> {
when (stage) {
0 -> npcl(FacialExpression.NEUTRAL, " You saved my life and my son's, I am eternally in your debt brave taveller.").also { stage = END_DIALOGUE }
@@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.prisoners
package content.region.kandarin.ardougne.quest.arena
import core.api.isEquipped
import core.api.sendNPCDialogue
@@ -13,9 +13,6 @@ import org.rs09.consts.NPCs
@Initializable
class KelvinDialogue(player: Player? = null) : DialoguePlugin(player) {
// Kelvin - NPC inside prison cell.
// Source: https://runescape.wiki/w/Kelvin?oldid=2632956
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player, Items.KHAZARD_HELMET_74) && isEquipped(player, Items.KHAZARD_ARMOUR_75)) {
@@ -1,6 +1,5 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@@ -12,19 +11,14 @@ import org.rs09.consts.Items.COINS_995
import org.rs09.consts.NPCs
class KhazardBarmanDialogue : DialogueFile() {
// Khazard barman
// source: https://runescape.wiki/w/Angor?oldid=1079592
override fun handle(componentID: Int, buttonID: Int) {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = NPC(NPCs.KHAZARD_BARMAN_259)
when {
// Talking to Khazard barman
(questStage in 49 downTo 0) -> {
when (stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello. I'll have a beer please.").also { stage = 1 }
@@ -38,7 +32,6 @@ class KhazardBarmanDialogue : DialogueFile() {
}
}
// Talking to Khazard barman
(questStage in 100 downTo 50) -> {
when (stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello.").also { stage++ }
@@ -53,14 +46,12 @@ class KhazardBarmanDialogue : DialogueFile() {
5 -> npcl(FacialExpression.NEUTRAL, "If you want to see the action around here you should visit the famous Khazard fight arena. I've seen some grand battles in my time. Ogres, goblins, even dragons have fought there.").also { stage = 6 }
6 -> npcl(FacialExpression.WORRIED, "Although you have to feel sorry for some of the slaves sent in there.").also { stage = END_DIALOGUE }
7 -> npcl(FacialExpression.FRIENDLY, "There you go, that's five gold coins. I suggest lying down before you drink it. That way you have less distance to collapse.").also { stage = 9 }
8 -> if (inInventory(player!!, COINS_995, 2)) {
end()
removeItem(player!!, Item(COINS_995, 2)) && addItem(player!!, Items.BEER_1917, 1).also { stage = END_DIALOGUE }
} else {
playerl(FacialExpression.STRUGGLE, "Oh, I don't have enough money with me.").also { stage = END_DIALOGUE }
}
9 -> if (inInventory(player!!, COINS_995, 5)) {
end()
removeItem(player!!, Item(COINS_995, 5)) && addItem(player!!, Items.KHALI_BREW_77, 1).also { setQuestStage(player!!, FightArena.FightArenaQuest, 60) }.also { stage = END_DIALOGUE }
@@ -1,7 +1,5 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import content.region.kandarin.ardougne.quest.fightarena.npcs.GeneralKhazardDialogue
import core.api.*
import core.game.node.entity.Entity
import core.game.node.entity.npc.AbstractNPC
@@ -1,8 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import content.region.kandarin.ardougne.quest.fightarena.npcs.GeneralKhazardDialogue
import core.api.*
import core.game.node.entity.Entity
import core.game.node.entity.npc.AbstractNPC
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena.Companion.FightArenaQuest
import content.region.kandarin.ardougne.quest.arena.FightArena.Companion.FightArenaQuest
import core.api.questStage
import core.api.setQuestStage
import core.game.dialogue.DialogueFile
@@ -10,17 +10,13 @@ import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
class LadyServilDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = NPC(NPCs.LADY_SERVIL_264)
when {
// Start the quest.
(questStage == 0) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hi there, looks like you're in some trouble.").also { stage++ }
@@ -40,7 +36,6 @@ class LadyServilDialogue : DialogueFile() {
}
}
// Talking to Lady Servil after starting the quest.
(questStage == 10) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello Lady Servil.").also { stage++ }
@@ -48,7 +43,6 @@ class LadyServilDialogue : DialogueFile() {
}
}
// Talking to Lady Servil after getting armour.
(questStage == 20) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello Lady Servil.").also { stage++ }
@@ -58,7 +52,6 @@ class LadyServilDialogue : DialogueFile() {
}
}
// Talking to Lady Servil after entering the arena.
(questStage == 30) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Lady Servil, I have managed to infiltrate General Khazard's arena.").also { stage++ }
@@ -68,7 +61,6 @@ class LadyServilDialogue : DialogueFile() {
}
}
// Talking to Lady Servil after freeing Jeremy from the jail.
(questStage == 70) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Lady Servil. I freed your son, however he has returned to the arena to help your husband.").also { stage++ }
@@ -76,7 +68,6 @@ class LadyServilDialogue : DialogueFile() {
}
}
// Talking to Lady Servil to complete the quest and get reward.
(questStage == 99) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Lady Servil.").also { stage++ }
@@ -88,7 +79,6 @@ class LadyServilDialogue : DialogueFile() {
}
}
// Talking to Lady Servil after the complete the quest.
(questStage == 100) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello Servil.").also { stage++ }
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArena.Companion.FightArenaQuest
import content.region.kandarin.ardougne.quest.arena.FightArena.Companion.FightArenaQuest
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
@@ -12,17 +12,13 @@ import org.rs09.consts.Items.KHAZARD_CELL_KEYS_76
import org.rs09.consts.NPCs
class KhazardGuardDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = NPC(NPCs.A_LAZY_KHAZARD_GUARD_8498)
when {
// Talking to Lazy Khazard Guard.
(questStage == 40) -> {
when (stage) {
0 -> player!!.faceLocation(location(2617, 3144, 0)).also { playerl(FacialExpression.NEUTRAL, "Long live General Khazard!") }.also { stage++ }
@@ -32,7 +28,6 @@ class KhazardGuardDialogue : DialogueFile() {
}
}
// When we try talk to guard again.
(questStage == 50) -> {
when (stage) {
0 -> player!!.faceLocation(location(2617, 3144, 0)).also { playerl(FacialExpression.NEUTRAL, "Hello, how's the job?") }.also { stage++ }
@@ -40,7 +35,6 @@ class KhazardGuardDialogue : DialogueFile() {
}
}
// Talking to Lazy Khazard Guard having khali beer in inventory.
(questStage == 60) -> {
when (stage) {
0 -> player!!.faceLocation(location(2617, 3144, 0)).also { playerl(FacialExpression.FRIENDLY, "Hello again.") }.also { stage++ }
@@ -71,13 +65,11 @@ class KhazardGuardDialogue : DialogueFile() {
}
}
// Talking to Lazy Khazard Guard ~
(questStage in 68..100) -> {
when (stage) { // after we got the keys.
when (stage) {
0 -> if (player!!.inventory.containItems(KHAZARD_CELL_KEYS_76)) {
player!!.faceLocation(location(2617, 3144, 0)).also { sendPlayerDialogue(player!!, "Hello, how's the job?", FacialExpression.NEUTRAL) }.also { stage = 1 }
} else { // after we got lost the keys.
} else {
player!!.faceLocation(location(2617, 3144, 0)).also { sendPlayerDialogue(player!!, "Hi, er.. I lost the keys.", FacialExpression.NEUTRAL) }.also { stage = 2 }
}
1 -> npcl(FacialExpression.DRUNK, "Please, leave me alone. I'm sure the walls never used to sway that much.").also { stage = END_DIALOGUE }
@@ -1,4 +1,4 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues
package content.region.kandarin.ardougne.quest.arena
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
@@ -10,9 +10,6 @@ import org.rs09.consts.NPCs
@Initializable
class LocalDialogue(player: Player? = null) : DialoguePlugin(player) {
// Local - NPC outside of fight arena.
// Source: https://runescape.wiki/w/Local?oldid=572441
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (player.questRepository.getStage("Fight Arena") >= 10) {
@@ -1,7 +1,7 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.FightArenaListeners.Companion.Jeremy
import content.region.kandarin.ardougne.quest.fightarena.npcs.enemies.KhazardOgreNPC.Companion.spawnOgre
import content.region.kandarin.ardougne.quest.arena.FightArenaListeners.Companion.Jeremy
import content.region.kandarin.ardougne.quest.arena.KhazardOgreNPC.Companion.spawnOgre
import core.api.*
import core.game.activity.Cutscene
import core.game.dialogue.FacialExpression
@@ -14,9 +14,6 @@ import core.net.packet.context.MinimapStateContext
import core.net.packet.out.MinimapState
class RescueCutscene(player: Player) : Cutscene(player) {
// Jeremy rescue & first fight with Ogre.
// Source: https://youtu.be/-wV5dIyM0YM?t=182
override fun setup() {
setExit(location(2603, 3155, 0))
if (player.settings.isRunToggled) {
@@ -27,8 +24,6 @@ class RescueCutscene(player: Player) : Cutscene(player) {
override fun runStage(stage: Int) {
when (stage) {
// ---------------- Prologue ----------------
0 -> {
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 1))
move(Jeremy, 56, 31)
@@ -63,15 +58,13 @@ class RescueCutscene(player: Player) : Cutscene(player) {
timedUpdate(5)
}
// ---------------- Cutscene ----------------
6 -> {
loadRegion(10289)
addNPC(JEREMYRESCUE, 41, 17, Direction.NORTH)
addNPC(GENERAL, 45, 19, Direction.NORTH)
addNPC(OGRE, 48, 30, Direction.NORTH)
addNPC(JUSTIN, 41, 32, Direction.EAST)
timedUpdate(1)
timedUpdate(-1)
}
7 -> {
@@ -104,12 +97,10 @@ class RescueCutscene(player: Player) : Cutscene(player) {
timedUpdate(3)
}
// ---------------- Baldur's Gate ----------------
12 -> {
player.faceLocation(getNPC(JEREMYRESCUE)!!.location)
sendPlayerDialogue(player, "Jeremy, where's your father?", FacialExpression.NEUTRAL)
timedUpdate(2)
timedUpdate(1)
}
13 -> {
@@ -138,8 +129,6 @@ class RescueCutscene(player: Player) : Cutscene(player) {
timedUpdate(2)
}
// ---------------- End & Spawn Ogre ----------------
17 -> {
end {
spawnOgre(player)
@@ -1,6 +1,6 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
package content.region.kandarin.ardougne.quest.arena
import content.region.kandarin.ardougne.quest.fightarena.npcs.enemies.KhazardScorpionNPC.Companion.spawnScorpion
import content.region.kandarin.ardougne.quest.arena.KhazardScorpionNPC.Companion.spawnScorpion
import core.api.*
import core.game.activity.Cutscene
import core.game.global.action.DoorActionHandler
@@ -24,8 +24,6 @@ class ScorpionCutscene(player: Player) : Cutscene(player) {
override fun runStage(stage: Int) {
when (stage) {
// ---------------- Leaving cell ----------------
0 -> {
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 1))
addNPC(GUARD, 36, 5, Direction.EAST)
@@ -80,8 +78,6 @@ class ScorpionCutscene(player: Player) : Cutscene(player) {
timedUpdate(8)
}
// ---------------- Enter arena ----------------
10 -> {
sendChat(getNPC(GUARD)!!, "Get out! there.")
DoorActionHandler.handleAutowalkDoor(player, getScenery(2606, 3152, 0))
@@ -104,8 +100,6 @@ class ScorpionCutscene(player: Player) : Cutscene(player) {
timedUpdate(3)
}
// ---------------- Scorpion zoom ----------------
14 -> {
loadRegion(10289)
addNPC(SCORPION, 47, 23, Direction.WEST)
@@ -134,8 +128,6 @@ class ScorpionCutscene(player: Player) : Cutscene(player) {
timedUpdate(1)
}
// ---------------- End & Spawn scorpion ----------------
18 -> {
end {
spawnScorpion(player)
@@ -1,45 +0,0 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.guards
import core.api.isEquipped
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class KhazardGuard253Dialogue(player: Player? = null) : DialoguePlugin(player) {
// Khazard Guards - Around Arena.
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 2 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.ASKING, "Can I help you stranger?").also { stage = 1 }
1 -> npcl(FacialExpression.FRIENDLY, "Oh, you're a guard as well. That's ok then. We don't like strangers around here").also { stage = END_DIALOGUE }
}
when (stage) {
2 -> npcl(FacialExpression.ANNOYED, "I don't know you stranger. Get off our land.").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KhazardGuard253Dialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_253)
}
}
@@ -1,51 +0,0 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.guards
import core.api.isEquipped
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class KhazardGuard254Dialogue(player: Player? = null) : DialoguePlugin(player) {
// Khazard Guards - Inside the prison.
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 7 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "I've never seen you around here before!").also { stage = 1 }
1 -> playerl(FacialExpression.FRIENDLY, "Long live General Khazard!").also { stage = 2 }
2 -> npcl(FacialExpression.FRIENDLY, "Erm.. yes.. soldier, I take it you're new around here?").also { stage = 3 }
3 -> playerl(FacialExpression.FRIENDLY, "You could say that.").also { stage = 4 }
4 -> npcl(FacialExpression.FRIENDLY, "Khazard died two hundred years ago. However his dark spirit remains in the form of the undead maniac General Khazard. Remember he is your master, always watching.").also { stage = 5 }
5 -> npcl(FacialExpression.FRIENDLY, "Got that newbie?").also { stage = 6 }
6 -> playerl(FacialExpression.FRIENDLY, "Undead, maniac, master. Got it, loud and clear.").also { stage = END_DIALOGUE }
}
when (stage) {
7 -> npcl(FacialExpression.ANNOYED, "This area is restricted, leave now!").also { stage = 8 }
8 -> npcl(FacialExpression.ANGRY, "OUT! And don't come back!").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KhazardGuard254Dialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_254)
}
}
@@ -1,45 +0,0 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.guards
import core.api.isEquipped
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class KhazardGuard255Dialogue(player: Player? = null) : DialoguePlugin(player) {
// Khazard Guard - Outside.
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 2 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.ASKING, "Can I help you stranger?").also { stage = 1 }
1 -> npcl(FacialExpression.FRIENDLY, "Oh, you're a guard as well. That's ok then. We don't like strangers around here.").also { stage = END_DIALOGUE }
}
when (stage) {
2 -> npcl(FacialExpression.ANNOYED, "This area is restricted, leave now!").also { stage = 3 }
3 -> npcl(FacialExpression.ANGRY, "OUT! And don't come back!").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KhazardGuard255Dialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_255)
}
}
@@ -1,46 +0,0 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.guards
import core.api.isEquipped
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.plugin.Initializable
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
import org.rs09.consts.NPCs
@Initializable
class KhazardGuard256Dialogue(player: Player? = null) : DialoguePlugin(player) {
// Khazard Guard - Chest room.
override fun open(vararg args: Any?): Boolean {
npc = args[0] as NPC
if (isEquipped(player!!, Items.KHAZARD_HELMET_74) && isEquipped(player!!, Items.KHAZARD_ARMOUR_75)) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hi.").also { stage = 3 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.ANGRY, "Despicable thieving scum, that was good armour. Did you see anyone around here soldier?").also { stage = 1 }
1 -> playerl(FacialExpression.SILENT, "Me? No, no one!").also { stage = 2 }
2 -> npcl(FacialExpression.SUSPICIOUS, "Hmmmm").also { stage = END_DIALOGUE }
}
when (stage) {
3 -> npcl(FacialExpression.ANNOYED, "I don't know who you are. Get out of my house stranger.").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KhazardGuard256Dialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_GUARD_256)
}
}