Implemented Fight Arena quest

This commit is contained in:
szumaster
2023-02-04 08:54:59 +00:00
committed by Ryan
parent c112794ede
commit 9fc92f52f4
29 changed files with 2337 additions and 87 deletions
+13 -9
View File
@@ -702,29 +702,33 @@
},
{
"remove_head": "true",
"destroy_message": "I can borrow another from the armoury near the Fight Arena.",
"shop_price": "10",
"examine": "A helmet, as worn by the minions of General Khazard.",
"durability": null,
"name": "Khazard helmet",
"weight": "2.7",
"destroy": "true",
"equipment_slot": "0",
"destroy_message": "I can borrow another from the armoury near the Fight Arena.",
"name": "Khazard helmet",
"tradeable": "false",
"archery_ticket_price": "0",
"id": "74",
"bonuses": "0,0,0,0,0,4,5,3,0,0,0,0,0,0,0",
"equipment_slot": "0"
"bonuses": "0,0,0,0,0,4,5,3,0,0,0,0,0,0,0"
},
{
"destroy_message": "I can borrow another from the armoury near the Fight Arena.",
"remove_sleeves": "true",
"shop_price": "12",
"examine": "Armour, as worn by the minions of General Khazard.",
"durability": null,
"name": "Khazard armour",
"weight": "0.5",
"destroy": "true",
"equipment_slot": "4",
"destroy_message": "I can borrow another from the armoury near the Fight Arena.",
"remove_sleeves": "true",
"name": "Khazard armour",
"tradeable": "false",
"archery_ticket_price": "0",
"id": "75",
"bonuses": "0,0,0,0,0,9,11,10,0,0,0,0,0,0,0",
"equipment_slot": "4"
"bonuses": "0,0,0,0,0,9,11,10,0,0,0,0,0,0,0"
},
{
"destroy_message": "The lazy guard probably has a spare set...",
+187 -66
View File
@@ -182,15 +182,15 @@
},
{
"examine": "He tries to keep order around here.",
"melee_animation": "381",
"melee_animation": "284",
"range_animation": "0",
"combat_audio": "511,513,512",
"attack_speed": "4",
"respawn_delay": "60",
"defence_animation": "1156",
"defence_animation": "285",
"weakness": "9",
"magic_animation": "0",
"death_animation": "836",
"death_animation": "287",
"name": "Guard",
"defence_level": "13",
"safespot": null,
@@ -4002,44 +4002,53 @@
"attack_level": "1"
},
{
"examine": "He's guarding the door.",
"melee_animation": "0",
"examine": "It's one of General Khazard's guards.",
"melee_animation": "395",
"range_animation": "0",
"defence_animation": "0",
"attack_speed": "6",
"combat_audio": "511,513,512",
"respawn_delay": "60",
"defence_animation": "397",
"weakness": "6",
"magic_animation": "0",
"death_animation": "0",
"death_animation": "836",
"name": "Khazard Guard",
"defence_level": "1",
"defence_level": "22",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "31",
"strength_level": "22",
"id": "253",
"range_level": "1",
"attack_level": "1"
"attack_level": "22"
},
{
"examine": "He's been guarding the tavern for a bit too long.",
"melee_animation": "0",
"melee_animation": "395",
"range_animation": "0",
"defence_animation": "0",
"attack_speed": "6",
"combat_audio": "511,513,512",
"respawn_delay": "60",
"defence_animation": "397",
"weakness": "6",
"magic_animation": "0",
"death_animation": "0",
"death_animation": "836",
"name": "Khazard Guard",
"defence_level": "1",
"defence_level": "22",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"lifepoints": "31",
"strength_level": "22",
"id": "254",
"range_level": "1",
"attack_level": "1"
"attack_level": "22"
},
{
"examine": "His armour indicates he's a Khazard Guard.",
"melee_animation": "395",
"range_animation": "0",
"attack_speed": "6",
"combat_audio": "511,513,512",
"respawn_delay": "60",
"defence_animation": "0",
"defence_animation": "397",
"weakness": "6",
"magic_animation": "0",
"death_animation": "836",
@@ -4057,8 +4066,9 @@
"melee_animation": "395",
"range_animation": "0",
"attack_speed": "6",
"combat_audio": "511,513,512",
"respawn_delay": "60",
"defence_animation": "0",
"defence_animation": "397",
"weakness": "6",
"magic_animation": "0",
"death_animation": "836",
@@ -4071,6 +4081,66 @@
"range_level": "1",
"attack_level": "22"
},
{
"examine": "He takes the slaves to the arena. He rarely takes them back..",
"melee_animation": "395",
"range_animation": "0",
"attack_speed": "6",
"combat_audio": "511,513,512",
"respawn_delay": "60",
"defence_animation": "397",
"weakness": "6",
"magic_animation": "0",
"death_animation": "836",
"name": "Khazard Guard",
"defence_level": "22",
"safespot": null,
"lifepoints": "31",
"strength_level": "22",
"id": "257",
"range_level": "1",
"attack_level": "22"
},
{
"examine": "He looks really nasty. Smells bad too.",
"melee_animation": "7049",
"range_animation": "0",
"attack_speed": "4",
"combat_audio": "511,513,512",
"respawn_delay": "60",
"defence_animation": "7050",
"weakness": "6",
"magic_animation": "0",
"death_animation": "836",
"name": "General Khazard",
"defence_level": "80",
"safespot": null,
"lifepoints": "170",
"strength_level": "78",
"id": "258",
"range_level": "1",
"attack_level": "75"
},
{
"examine": "A tough looking barman.",
"melee_animation": "0",
"range_animation": "0",
"attack_speed": "6",
"combat_audio": "511,513,512",
"respawn_delay": "60",
"defence_animation": "397",
"weakness": "6",
"magic_animation": "0",
"death_animation": "0",
"name": "Khazard barman",
"defence_level": "1",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"id": "259",
"range_level": "1",
"attack_level": "1"
},
{
"examine": "A slave fighter. He looks mistreated and weak.",
"melee_animation": "0",
@@ -4087,29 +4157,103 @@
"range_level": "1",
"attack_level": "1"
},
{
"examine": "She looks wealthy.",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"name": "Lady Servil",
"defence_level": "1",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"id": "264",
"range_level": "1",
"attack_level": "1"
},
{
"examine": "A young squire. He looks worse for wear.",
"magic_animation": "0",
"death_animation": "0",
"name": "Jeremy Servil",
"defence_level": "0",
"safespot": null,
"lifepoints": "10",
"strength_level": "0",
"id": "265",
"clue_level": "0",
"range_level": "0",
"attack_level": "0"
},
{
"examine": "A young squire. He looks worse for wear.",
"magic_animation": "0",
"death_animation": "0",
"name": "Jeremy Servil",
"defence_level": "0",
"safespot": null,
"lifepoints": "10",
"strength_level": "0",
"id": "266",
"clue_level": "0",
"range_level": "0",
"attack_level": "0"
},
{
"examine": "Jeremy father, Sir Servil.",
"magic_animation": "0",
"death_animation": "0",
"name": "Justin Servil",
"defence_level": "0",
"safespot": null,
"lifepoints": "10",
"strength_level": "0",
"id": "267",
"clue_level": "0",
"range_level": "0",
"attack_level": "0"
},
{
"examine": "A scruffy looking chap.",
"magic_animation": "0",
"death_animation": "0",
"name": "Local",
"defence_level": "0",
"safespot": null,
"lifepoints": "10",
"strength_level": "0",
"id": "268",
"clue_level": "0",
"range_level": "0",
"attack_level": "0"
},
{
"melee_animation": "6581",
"respawn_delay": "60",
"defence_animation": "6578",
"death_animation": "6576",
"name": "Bouncer",
"defence_level": "1",
"defence_level": "120",
"safespot": null,
"lifepoints": "116",
"strength_level": "1",
"strength_level": "120",
"id": "269",
"aggressive": "true",
"range_level": "1",
"attack_level": "1"
"attack_level": "120"
},
{
"examine": "Khazard's strongest ogre warrior.",
"melee_animation": "2100",
"range_animation": "0",
"defence_animation": "0",
"weakness": "6",
"magic_animation": "0",
"death_animation": "8576",
"melee_animation": "359",
"range_animation": "359",
"attack_speed": "6",
"magic_level": "1",
"respawn_delay": "25",
"defence_animation": "360",
"magic_animation": "359",
"death_animation": "361",
"name": "Khazard Ogre",
"defence_level": "46",
"safespot": null,
@@ -4117,11 +4261,12 @@
"strength_level": "46",
"id": "270",
"aggressive": "true",
"bonuses": "22,22,22,0,0,0,0,0,0,0,0,20,0,0,0",
"range_level": "1",
"attack_level": "46"
},
{
"examine": "A large",
"examine": "A large angry scorpion",
"melee_animation": "6254",
"range_animation": "0",
"combat_audio": "3611,3612,3610",
@@ -10754,18 +10899,14 @@
},
{
"examine": "A soldier of the Imperial Guard.",
"combat_audio": "511,513,512",
"melee_animation": "393",
"attack_speed": "4",
"magic_level": "1",
"defence_animation": "397",
"death_animation": "836",
"name": "Soldier",
"defence_level": "44",
"safespot": null,
"lifepoints": "55",
"combat_audio": "511,513,512",
"strength_level": "44",
"id": "1065",
"magic_level": "1",
"range_level": "1",
"attack_level": "44"
},
@@ -10837,25 +10978,6 @@
"range_level": "1",
"attack_level": "1"
},
{
"examine": "The Burthorpe Castle cook.",
"melee_animation": "422",
"range_animation": "422",
"combat_audio": "511,506,505",
"attack_speed": "4",
"defence_animation": "404",
"weakness": "9",
"magic_animation": "422",
"death_animation": "9055",
"name": "Eadburg",
"defence_level": "1",
"safespot": null,
"lifepoints": "10",
"strength_level": "1",
"id": "1072",
"range_level": "1",
"attack_level": "1"
},
{
"examine": "A Burthorpe Castle Archer.",
"start_gfx": "19",
@@ -10902,13 +11024,13 @@
},
{
"examine": "A Burthorpe Castle guard.",
"melee_animation": "395",
"melee_animation": "0",
"range_animation": "0",
"combat_audio": "511,513,512",
"magic_level": "1",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "836",
"death_animation": "0",
"name": "Guard",
"defence_level": "33",
"safespot": null,
@@ -10921,13 +11043,13 @@
},
{
"examine": "A Burthorpe Castle guard.",
"melee_animation": "395",
"melee_animation": "0",
"range_animation": "0",
"combat_audio": "511,513,512",
"magic_level": "1",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "836",
"death_animation": "0",
"name": "Guard",
"defence_level": "33",
"safespot": null,
@@ -10940,12 +11062,11 @@
},
{
"examine": "A servant for Prince Anlaf.",
"melee_animation": "422",
"range_animation": "422",
"combat_audio": "511,513,512",
"defence_animation": "404",
"magic_animation": "422",
"death_animation": "9055",
"melee_animation": "0",
"range_animation": "0",
"defence_animation": "0",
"magic_animation": "0",
"death_animation": "0",
"name": "Servant",
"defence_level": "1",
"safespot": null,
@@ -71212,4 +71333,4 @@
"range_level": "1",
"attack_level": "1"
}
]
]
+40 -12
View File
@@ -697,51 +697,79 @@
},
{
"npc_id": "253",
"loc_data": "{2616,3172,0,1,1}-{2583,3142,0,1,6}"
"loc_data": "{2580,3163,0,1,1}-{2590,3184,0,1,1}-{2589,3140,0,1,1}-{2601,3177,0,1,1}-{2607,3182,0,1,1}-{2612,3187,0,1,1}"
},
{
"npc_id": "254",
"loc_data": "{2565,3150,0,1,6}-{2564,3146,0,1,5}-{2572,3143,0,1,4}"
"loc_data": "{2569,3149,0,0,1}-{2614,3169,0,1,1}-{2564,3153,0,1,1}-{2568,3147,0,1,1}-{2579,3176,0,1,3}-{2580,3174,0,1,1}-{2584,3149,0,1,3}-{2590,3190,0,1,1}-{2594,3181,0,1,1}-{2595,3186,0,1,1}-{2597,3175,0,1,1}-{2597,3181,0,1,1}-{2607,3185,0,1,1}-{2614,3150,0,1,1}-{2619,3168,0,1,1}"
},
{
"npc_id": "255",
"loc_data": "{2601,3195,0,1,3}-{2615,3188,0,1,6}-{2606,3186,0,1,3}"
"loc_data": "{2571,3142,0,1,1}-{2617,3150,0,1,1}-{2609,3171,0,0,1}-{2617,3157,0,1,1}-{2577,3167,0,1,1}-{2597,3176,0,1,1}-{2607,3181,0,1,1}-{2608,3148,0,1,1}-{2600,3190,0,1,1}-{2610,3150,0,1,1}-{2609,3171,0,1,1}"
},
{
"npc_id": "256",
"loc_data": "{2568,3144,0,1,3}-{2606,3180,0,1,5}-{2600,3184,0,1,4}-{2598,3185,0,1,6}-{2593,3175,0,1,2}-{2594,3182,0,1,3}-{2594,3188,0,1,3}-{2593,3193,0,1,3}-{2592,3179,0,1,1}-{2605,3171,0,1,3}-{2581,3170,0,1,6}-{2580,3166,0,1,6}-{2577,3163,0,1,1}-{2585,3150,0,1,4}"
"loc_data": "{2609,3194,0,1,2}"
},
{
"npc_id": "257",
"loc_data": ""
},
{
"npc_id": "258",
"loc_data": ""
},
{
"npc_id": "259",
"loc_data": "{2567,3140,0,0,0}"
"loc_data": "{2566,3140,0,0,1}"
},
{
"npc_id": "260",
"loc_data": "{2589,3142,0,0,0}"
"loc_data": "{2589,3142,0,1,4}"
},
{
"npc_id": "261",
"loc_data": "{2587,3142,0,0,0}"
"loc_data": "{2587,3142,0,1,3}"
},
{
"npc_id": "262",
"loc_data": "{2616,3162,0,0,0}-{2616,3161,0,0,0}-{2596,3142,0,0,0}"
"loc_data": "{2615,3160,0,1,4}-{2616,3164,0,1,1}-{2594,3143,0,0,2}"
},
{
"npc_id": "263",
"loc_data": "{2597,3143,0,0,0}"
"loc_data": "{2597,3143,0,0,4}"
},
{
"npc_id": "264",
"loc_data": "{2568,3200,0,1,0}"
},
{
"npc_id": "265",
"loc_data": "{2616,3167,0,0,0}"
"loc_data": ""
},
{
"npc_id": "266",
"loc_data": "{2601,3154,0,1,0}"
},
{
"npc_id": "267",
"loc_data": "{2601,3168,0,0,0}"
"loc_data": "{2601,3168,0,0,3}"
},
{
"npc_id": "268",
"loc_data": "{2583,3171,0,0,0}"
"loc_data": "{2582,3172,0,1,1}"
},
{
"npc_id": "269",
"loc_data": "{2608,3163,0,1,3}"
},
{
"npc_id": "270",
"loc_data": "{2608,3165,0,1,3}"
},
{
"npc_id": "271",
"loc_data": "{2608,3158,0,1,3}"
},
{
"npc_id": "278",
@@ -0,0 +1,113 @@
package content.region.kandarin.ardougne.quest.fightarena
import core.api.addItemOrDrop
import core.api.rewardXP
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.quest.Quest
import core.game.node.entity.skill.Skills
import core.plugin.Initializable
import org.rs09.consts.Items.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) {
super.drawJournal(player, stage)
var line = 11
player ?: return
if (stage == 0) {
line(player, "I can start this quest by speaking to !!Lady Servil?? just", line++)
line(player, "!!North-West?? of the !!Khazard Port??.", line++)
line += 1
line(player, "I must be able to defeat a !!level 137?? enemy.", line++)
line++
}
if (stage >= 10) {
line(player, "I encountered a distraught Lady Servil,", line++, stage > 10)
line(player, "who said that her son and husband", line++, stage > 10)
line(player, "had been kidnapped by the evil General Khazard,", line++, stage > 10)
line(player, "and were being forced to fight in his fight arena.", line++, stage > 10)
line += 1
line(player, "I headed to the arena to try and find Lady Servil's son and husband.", line++, stage > 10)
line++
}
if (stage >= 20) {
line(player, "I found some Khazard armour in the armoury, on", line++, stage > 20)
line(player, "the north-east edge of town.", line++, stage > 20)
line(player, "I used it to disguise myself as a guard so I could look around", line++, stage > 20)
line++
}
if (stage >= 35) {
line(player, "I found Lady Servil's son,", line++, stage > 40)
line(player, "Jeremy Servil, in one of the prison cells.", line++, stage > 40)
line(player, "He told me that a bald, fat, lazy guard with a goatee", line++, stage > 40)
line(player, "was in charge of the keys.", line++, stage > 40)
line++
}
if (stage >= 50) {
line(player, "I found the guard Jeremy mentioned.", line++, stage > 55)
line(player, "He said that he'd like a drink,", line++, stage > 55)
line(player, "but too much Khali brew would make him fall asleep.", line++, stage > 55)
line++
}
if (stage >= 60) {
line(player, "I plied the lazy guard", line++, stage > 67)
line(player, "with some Khali brew and he passed out.", line++, stage > 67)
line(player, "I was able to get his keys.", line++, stage > 67)
line++
}
if (stage >= 68) {
line(player, "I found and freed Jeremy, who told me that", line++, stage > 69)
line(player, "his father had been taken to fight in the Fight Arena.", line++, stage > 69)
line(player, "We went there to save him.", line++, stage > 69)
line++
}
if (stage >= 71) {
line(player, "I had to fight a large ogre to stop it killing Sir Servil.", line++, stage > 72)
line(player, "When I'd defeated it, General Khazard had locked me up.", line++, stage > 72)
line++
}
if (stage >= 88) {
line(player, "I was led to the fight arena", line++, stage > 88)
line(player, "and forced to fight a colossal scorpion,", line++, stage > 89)
line(player, "followed by Khazard's monstrous pet dog called Bouncer.", line++, stage > 90)
line++
}
if (stage >= 91) {
line(player, "General Khazard released the Servils, but he was so angry", line++, stage >= 99)
line(player, "that I'd killed Bouncer that he came to fight me himself.", line++, stage >= 99)
line++
}
if (stage >= 99) {
line(player, "I escaped from the arena and returned to Lady Servil", line++, stage == 100)
line(player, "She thanked me profusely and rewarded me for my help.", line++, stage == 100)
}
if (stage == 100) {
line++
line(player, "!!QUEST COMPLETE??", line, true)
}
}
override fun finish(player: Player?) {
super.finish(player)
player ?: return
var ln = 10
player.packetDispatch.sendItemZoomOnInterface(COINS_995, 230, 277, 5)
drawReward(player, "2 Quest Point", ln++)
drawReward(player, "12,175 Attack XP", ln++)
drawReward(player, "2,175 Thieving XP", ln++)
drawReward(player, "1000 gold coins", ln)
rewardXP(player, Skills.ATTACK, 12175.0)
rewardXP(player, Skills.THIEVING, 2175.0)
addItemOrDrop(player, COINS_995, 1000)
}
}
@@ -0,0 +1,276 @@
package content.region.kandarin.ardougne.quest.fightarena
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
import core.game.global.action.DoorActionHandler
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.entity.npc.NPC
import core.game.world.map.Location
import org.rs09.consts.Items
import org.rs09.consts.NPCs
import org.rs09.consts.Scenery
class FightArenaListeners : InteractionListener {
companion object {
const val GENERAL = 258
const val BARMAN = 259
const val KELVIN = 260
const val JOE = 261
const val FIGHTSLAVE = 262
const val HENGARD = 263
const val LADY = 264
const val JEREMY = 265
const val JEREMYRESCUE = 266
const val JUSTIN = 267
const val OTHERPRISONDOORS = Scenery.PRISON_DOOR_79
const val JEREMYPRISONDOOR = Scenery.PRISON_DOOR_80
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))
}
init {
Jeremy.init()
Jeremy.isWalks = true
General.init()
General.isWalks = true
}
override fun defineListeners() {
//------------------------- Npcs -------------------------
on(GENERAL, IntType.NPC, "talk-to") { player, npc ->
openDialogue(player, GeneralKhazardDialogue(), npc)
return@on true
}
on(BARMAN, IntType.NPC, "talk-to") { player, npc ->
openDialogue(player, KhazardBarmanDialogue(), npc)
return@on true
}
on(HENGARD, IntType.NPC, "talk-to") { player, npc ->
openDialogue(player, HengradDialogue(), npc)
return@on true
}
on(LADY, IntType.NPC, "talk-to") { player, npc ->
openDialogue(player, LadyServilDialogue(), npc)
return@on true
}
on(JEREMY, NPC, "talk-to") { player, npc ->
openDialogue(player, JeremyServilDialogue(), npc)
return@on true
}
on(JEREMYRESCUE, IntType.NPC, "talk-to") { player, npc ->
openDialogue(player, JeremyServilRescuedDialogue(), npc)
return@on true
}
on(JUSTIN, IntType.NPC, "talk-to") { player, npc ->
openDialogue(player, JustinServilDialogue(), npc)
return@on true
}
on(LAZYGUARD, SCENERY, "talk-to") { player, node ->
openDialogue(player, KhazardGuardDialogue(), node)
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.")
return@on false
} else if (player.questRepository.getStage("Fight Arena") == 10 && player.equipment.containItems(HELMET) || player.bank.containItems(HELMET) || player.equipment.containItems(ARMOUR) || player.bank.containItems(ARMOUR)) {
sendMessage(player, "Nothing interesting happens.")
return@on false
} else if (player.questRepository.getStage("Fight Arena") == 10 && player.inventory.containItems(ARMOUR) || player.inventory.containItems(HELMET)) {
sendMessage(player, "Nothing interesting happens.")
return@on false
} else if (player.questRepository.getStage("Fight Arena") == 10 && player.inventory.isFull) {
sendMessage(player, "You could borrow this suit of armour if you had space in your inventory.")
return@on false
} else {
sendMessage(player, "You borrow the suit of armour. It looks like it's just your size.")
addItem(player, HELMET, 1)
addItem(player, ARMOUR, 1)
}
}
// 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())
3172 -> {
if (isEquipped(player, HELMET) && isEquipped(player, ARMOUR)) {
openDialogue(player, EastDoorSupportDialogue())
} else {
sendPlayerDialogue(player, "This door appears to be locked.")
}
return@on true
}
}
when (player.location.x) {
2585 -> DoorActionHandler.handleAutowalkDoor(player, maingate.asScenery())
2584 -> {
if (isEquipped(player, HELMET) && isEquipped(player, ARMOUR)) {
openDialogue(player, WestDoorSupportDialogue())
} else {
sendPlayerDialogue(player, "This door appears to be locked.")
}
return@on true
}
}
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) {
openDialogue(player, JeremyServilDialogue())
} else {
sendMessage(player, "The cell gate is securely locked.")
return@onUseWith false
}
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.")
} else {
sendMessage(player, "The cell gate is securely locked.")
}
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())
return@on true
} else if (player.questRepository.getStage("Fight Arena") < 91) {
sendNPCDialogue(player, 255, "And where do you think you're going? Only General Khazard decides who fights in the arena. Get out of here.", FacialExpression.ANNOYED)
return@on false
} else {
sendMessage(player, "The gate is locked.")
return@on false
}
}
}
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)
}
}
//------------------------- 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)
when (stage) {
0 -> player!!.faceLocation(location(2617, 3170, 0)).also { playerl(FacialExpression.NEUTRAL, "This door appears to be locked.") }.also { stage++ }
1 -> player!!.faceLocation(location(2603, 3155, 0)).also { npcl(FacialExpression.NEUTRAL, "Nice observation guard. You could have just asked to be let in like a normal person.") }.also { stage++ }
2 -> {
end()
setQuestStage(player!!, FightArena.FightArenaQuest, 20)
DoorActionHandler.handleAutowalkDoor(player, getScenery(2617, 3172, 0)).also { player!!.unlock() }
}
}
}
}
class WestDoorSupportDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
npc = NPC(NPCs.KHAZARD_GUARD_257)
when (stage) {
0 -> player!!.faceLocation(location(2585, 3141, 0)).also { playerl(FacialExpression.NEUTRAL, "This door appears to be locked.") }.also { stage++ }
1 -> player!!.faceLocation(location(2603, 3155, 0)).also { npcl(FacialExpression.NEUTRAL, "Nice observation guard. You could have just asked to be let in like a normal person.") }.also { stage++ }
2 -> {
end()
setQuestStage(player!!, FightArena.FightArenaQuest, 20)
DoorActionHandler.handleAutowalkDoor(player, getScenery(2584, 3141, 0)).also { player!!.unlock() }
}
}
}
}
}
@@ -0,0 +1,87 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
import content.region.kandarin.ardougne.quest.fightarena.npcs.enemies.BouncerNPC.Companion.spawnBouncer
import core.api.getScenery
import core.api.location
import core.api.replaceScenery
import core.game.activity.Cutscene
import core.game.global.action.DoorActionHandler
import core.game.node.entity.player.Player
import core.game.node.scenery.Scenery
import core.game.world.map.Direction
import core.net.packet.PacketRepository
import core.net.packet.context.MinimapStateContext
import core.net.packet.out.MinimapState
import org.rs09.consts.Scenery.PRISON_DOOR_79
import org.rs09.consts.Scenery.PRISON_DOOR_80
class BouncerCutscene(player: Player) : Cutscene(player) {
override fun setup() {
setExit(player.location.transform(0, 0, 0))
if (player.settings.isRunToggled) {
player.settings.toggleRun()
}
}
override fun runStage(stage: Int) {
when (stage) {
// ------------------ Settings ------------------
0 -> {
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 1))
loadRegion(10289)
addNPC(BOUNCER, 47, 26, Direction.WEST)
teleport(player, 43, 19)
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)
}
2 -> {
DoorActionHandler.handleAutowalkDoor(getNPC(BOUNCER)!!, getScenery(174, 27, 0))
DoorActionHandler.handleAutowalkDoor(getNPC(BOUNCER)!!, getScenery(174, 26, 0))
timedUpdate(1)
}
3 -> {
move(getNPC(BOUNCER)!!, 45, 26)
moveCamera(39, 27, 300, 1)
rotateCamera(44, 27, 300, 1)
timedUpdate(1)
}
4 -> {
move(getNPC(BOUNCER)!!, 44, 26)
timedUpdate(1)
}
5 -> {
move(getNPC(BOUNCER)!!, 42, 26)
timedUpdate(-1)
}
// --------------- End & Spawn bouncer ---------------
6 -> {
end {
spawnBouncer(player)
}
}
}
}
companion object {
const val BOUNCER = 269
}
}
@@ -0,0 +1,102 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
import core.api.animate
import core.api.getScenery
import core.api.location
import core.game.activity.Cutscene
import core.game.component.Component
import core.game.dialogue.FacialExpression
import core.game.global.action.DoorActionHandler
import core.game.node.entity.player.Player
import core.game.world.map.Direction
import core.net.packet.PacketRepository
import core.net.packet.context.MinimapStateContext
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) {
player.settings.toggleRun()
}
}
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)
teleport(player, 46, 5)
timedUpdate(1)
}
1 -> {
moveCamera(45, 4, 400)
rotateCamera(41, 5)
timedUpdate(1)
}
2 -> {
move(player, 45, 5)
timedUpdate(3)
}
3 -> {
move(player, 40, 5)
move(getNPC(KHAZARD_GUARD)!!, 41, 5)
timedUpdate(8)
}
4 -> {
animate(getNPC(KHAZARD_GUARD)!!, 1060, true)
timedUpdate(2)
}
5 -> {
DoorActionHandler.handleAutowalkDoor(player, getScenery(2600, 3141, 0))
timedUpdate(2)
}
6 -> {
move(player, 40, 6)
move(getNPC(KHAZARD_GUARD)!!, 40, 5)
timedUpdate(3)
}
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)
}
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)
end {
}
}
}
}
companion object {
private const val KHAZARD_GUARD = 257
}
}
@@ -0,0 +1,158 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
import content.region.kandarin.ardougne.quest.fightarena.FightArenaListeners.Companion.Jeremy
import content.region.kandarin.ardougne.quest.fightarena.npcs.enemies.KhazardOgreNPC.Companion.spawnOgre
import core.api.*
import core.game.activity.Cutscene
import core.game.dialogue.FacialExpression
import core.game.global.action.DoorActionHandler
import core.game.node.entity.player.Player
import core.game.world.map.Direction
import core.game.world.map.Location
import core.net.packet.PacketRepository
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) {
player.settings.toggleRun()
}
}
override fun runStage(stage: Int) {
when (stage) {
// ---------------- Prologue ----------------
0 -> {
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 1))
move(Jeremy, 56, 31)
timedUpdate(2)
}
1 -> {
player.faceLocation(location(2616, 3167, 0))
animate(player, 2098)
timedUpdate(1)
}
2 -> {
move(player, 57, 32)
timedUpdate(-1)
}
3 -> {
DoorActionHandler.handleAutowalkDoor(Jeremy, getScenery(2617, 3167, 0))
player.faceLocation(location(2617, 3164, 0))
timedUpdate(2)
}
4 -> {
move(Jeremy, 57, 31)
timedUpdate(1)
}
5 -> {
sendChat(Jeremy, "I'll run ahead.")
move(Jeremy, 57, 20)
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)
}
7 -> {
moveCamera(47, 20)
rotateCamera(45, 15)
teleport(player, 47, 15)
Jeremy.teleport(Location.create(2616, 3167, 0))
timedUpdate(2)
}
8 -> {
DoorActionHandler.handleAutowalkDoor(player, getScenery(174, 16, 0))
moveCamera(41, 26, 300, 4)
rotateCamera(45, 15, 300, 4)
timedUpdate(-1)
}
9 -> {
move(player, 44, 17)
timedUpdate(2)
}
10 -> {
move(player, 43, 18)
timedUpdate(2)
}
11 -> {
move(player, 43, 19)
timedUpdate(3)
}
// ---------------- Baldur's Gate ----------------
12 -> {
player.faceLocation(getNPC(JEREMYRESCUE)!!.location)
sendPlayerDialogue(player, "Jeremy, where's your father?", FacialExpression.NEUTRAL)
timedUpdate(2)
}
13 -> {
getNPC(JEREMYRESCUE)!!.faceLocation(player.location)
sendNPCDialogue(player, JEREMYRESCUE, "Quick help him! That beast will kill him. He's too old to fight.")
teleport(getNPC(OGRE)!!, 45, 30)
move(getNPC(JUSTIN)!!, 42, 32)
timedUpdate(1)
}
14 -> {
moveCamera(42, 26)
rotateCamera(42, 26)
timedUpdate(-1)
}
15 -> {
move(getNPC(OGRE)!!, 43, 31)
timedUpdate(4)
}
16 -> {
getNPC(OGRE)!!.faceLocation(getNPC(JUSTIN)!!.location)
animate(getNPC(OGRE)!!, 359, true)
animate(getNPC(JUSTIN)!!, 404, true)
timedUpdate(2)
}
// ---------------- End & Spawn Ogre ----------------
17 -> {
end {
spawnOgre(player)
}
}
}
}
companion object {
private const val GENERAL = 258
private const val JEREMYRESCUE = 266
private const val JUSTIN = 267
private const val OGRE = 270
}
}
@@ -0,0 +1,151 @@
package content.region.kandarin.ardougne.quest.fightarena.cutscenes
import content.region.kandarin.ardougne.quest.fightarena.npcs.enemies.KhazardScorpionNPC.Companion.spawnScorpion
import core.api.*
import core.game.activity.Cutscene
import core.game.global.action.DoorActionHandler
import core.game.node.entity.player.Player
import core.game.node.scenery.Scenery
import core.game.world.map.Direction
import core.net.packet.PacketRepository
import core.net.packet.context.MinimapStateContext
import core.net.packet.out.MinimapState
import org.rs09.consts.Scenery.PRISON_DOOR_79
import org.rs09.consts.Scenery.PRISON_DOOR_80
class ScorpionCutscene(player: Player) : Cutscene(player) {
override fun setup() {
setExit(location(2603, 3155, 0))
if (player.settings.isRunToggled) {
player.settings.toggleRun()
}
}
override fun runStage(stage: Int) {
when (stage) {
// ---------------- Leaving cell ----------------
0 -> {
PacketRepository.send(MinimapState::class.java, MinimapStateContext(player, 1))
addNPC(GUARD, 36, 5, Direction.EAST)
timedUpdate(3)
}
1 -> {
move(getNPC(GUARD)!!, 39, 5)
sendChat(getNPC(GUARD)!!, "Right you, move it.")
move(player, 40, 6)
timedUpdate(5)
}
2 -> {
animate(getNPC(GUARD)!!, 805, true)
timedUpdate(2)
}
3 -> {
DoorActionHandler.handleAutowalkDoor(player, getObject(40, 5))
timedUpdate(2)
}
4 -> {
move(player, 42, 5)
timedUpdate(2)
}
5 -> {
move(player, 43, 6)
move(getNPC(GUARD)!!, 43, 6)
timedUpdate(-1)
}
6 -> {
move(player, 47, 15)
timedUpdate(1)
}
7 -> {
move(getNPC(GUARD)!!, 43, 6)
timedUpdate(2)
}
8 -> {
move(getNPC(GUARD)!!, 48, 7)
timedUpdate(6)
}
9 -> {
move(getNPC(GUARD)!!, 48, 14)
timedUpdate(8)
}
// ---------------- Enter arena ----------------
10 -> {
sendChat(getNPC(GUARD)!!, "Get out! there.")
DoorActionHandler.handleAutowalkDoor(player, getScenery(2606, 3152, 0))
move(getNPC(GUARD)!!, 47, 15)
timedUpdate(1)
}
11 -> {
move(player, 43, 19)
timedUpdate(2)
}
12 -> {
move(getNPC(GUARD)!!, 48, 14)
timedUpdate(1)
}
13 -> {
sendDialogue(player, "From above you hear a voice..... 'Ladies and gentlemen! Let today's first fight between the outsider and everyone's favourite scorpion commence.'")
timedUpdate(3)
}
// ---------------- Scorpion zoom ----------------
14 -> {
loadRegion(10289)
addNPC(SCORPION, 47, 23, Direction.WEST)
teleport(player, 43, 19)
timedUpdate(1)
}
15 -> {
moveCamera(42, 23)
rotateCamera(46, 23)
replaceScenery(Scenery(77, location(174, 23, 0)), PRISON_DOOR_79, 4)
replaceScenery(Scenery(78, location(174, 24, 0)), PRISON_DOOR_80, 4)
timedUpdate(1)
}
16 -> {
DoorActionHandler.handleAutowalkDoor(getNPC(SCORPION)!!, getScenery(174, 24, 0))
DoorActionHandler.handleAutowalkDoor(getNPC(SCORPION)!!, getScenery(174, 23, 0))
timedUpdate(1)
}
17 -> {
move(getNPC(SCORPION)!!, 45, 20)
moveCamera(40, 23, 300, 1)
rotateCamera(43, 23, 300, 1)
timedUpdate(1)
}
// ---------------- End & Spawn scorpion ----------------
18 -> {
end {
spawnScorpion(player)
}
}
}
}
companion object {
const val GUARD = 257
const val SCORPION = 271
}
}
@@ -0,0 +1,50 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues
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.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) {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Hello.").also { stage = 7 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "I heard the Servil family are fighting soon. Should be very entertaining.").also { stage = 1 }
1 -> npcl(FacialExpression.ASKING, "Hello stranger, are you new to these parts?").also { stage = 2 }
2 -> playerl(FacialExpression.ASKING, "I suppose I am.").also { stage = 3 }
3 -> npcl(FacialExpression.ASKING, "What's your business?").also { stage = 4 }
4 -> playerl(FacialExpression.ASKING, "Just visiting friends in the cells.").also { stage = 5 }
5 -> npcl(FacialExpression.LAUGH, "Visiting, that's funny.").also { stage = 6 }
6 -> npcl(FacialExpression.FRIENDLY, "Only Khazard guards are allowed to see prisoners. Unless you know where to get some Khazard armour, you won't be visiting anyone.").also { stage = END_DIALOGUE }
}
when (stage) {
7 -> npcl(FacialExpression.ASKING, "Hello stranger, are you new to these parts? You look lost.").also { stage = 8 }
8 -> npcl(FacialExpression.HALF_THINKING, "I suppose you're here for the fight arena? There are some rich folk fighting tomorrow. Should be entertaining.").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return LocalDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.LOCAL_268)
}
}
@@ -0,0 +1,45 @@
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)
}
}
@@ -0,0 +1,51 @@
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)
}
}
@@ -0,0 +1,45 @@
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)
}
}
@@ -0,0 +1,46 @@
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)
}
}
@@ -0,0 +1,46 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.prisoners
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 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)) {
playerl(FacialExpression.FRIENDLY, "Do you know of a Justin or Jeremy in this arena?").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Do you know of a Justin or Jeremy in this arena?").also { stage = 1 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> npcl(FacialExpression.FRIENDLY, "Please leave me alone.").also { stage = END_DIALOGUE }
}
when (stage) {
1 -> npcl(FacialExpression.AFRAID, "I've not met anybody in here by that name.").also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return FightslaveDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.FIGHTSLAVE_262)
}
}
@@ -0,0 +1,50 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.prisoners
import core.api.isEquipped
import core.api.sendNPCDialogue
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 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)) {
playerl(FacialExpression.FRIENDLY, "Do you know of a Justin or Jeremy in this arena?").also { stage = 0 }
} else {
playerl(FacialExpression.FRIENDLY, "Do you know of a Justin or Jeremy in this arena?").also { stage = 3 }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> sendNPCDialogue(player, NPCs.JOE_261, "If we did, why would we tell you guard?", FacialExpression.ANNOYED).also { stage = 1 }
1 -> sendNPCDialogue(player, NPCs.KELVIN_260, "Until our last breath, our every action will be against Khazard. Never will we help you.", FacialExpression.ANNOYED).also { stage = 2 }
2 -> sendNPCDialogue(player, NPCs.JOE_261, "I spit on Khazard's grave, and all who do his bidding.", FacialExpression.ANNOYED).also { stage = END_DIALOGUE }
}
when (stage) {
3 -> sendNPCDialogue(player, NPCs.KELVIN_260, "I have heard of those of whom you speak. But I fear it may be too late.", FacialExpression.HALF_GUILTY).also { stage = 4 }
4 -> sendNPCDialogue(player, NPCs.JOE_261, "It is said that Khazard has a personal vendetta against those two, their time is therefore short.", FacialExpression.FRIENDLY).also { stage = 5 }
5 -> sendNPCDialogue(player, NPCs.KELVIN_260, "You're a brave " + (if (player!!.isMale) "Sir" else "Madam") + ". If the guards get you, you'll be in here next.", FacialExpression.HALF_WORRIED).also { stage = END_DIALOGUE }
}
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return JoeDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.JOE_261)
}
}
@@ -0,0 +1,40 @@
package content.region.kandarin.ardougne.quest.fightarena.dialogues.prisoners
import core.api.isEquipped
import core.api.sendNPCDialogue
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 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)) {
sendNPCDialogue(player, NPCs.KELVIN_260, "Get away, get away. One day I'll have my revenge, and I'll have all your heads.", FacialExpression.ANNOYED).also { stage = END_DIALOGUE }
} else {
sendNPCDialogue(player, NPCs.KELVIN_260, "You're not safe here traveller. Leave while you still can", FacialExpression.FRIENDLY).also { stage = END_DIALOGUE }
}
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
return true
}
override fun newInstance(player: Player?): DialoguePlugin {
return KelvinDialogue(player)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KELVIN_260)
}
}
@@ -0,0 +1,109 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
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 core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.world.map.RegionManager
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)) {
sendPlayerDialogue(player!!, "General Khazard?").also { stage = 2 }
} else {
sendNPCDialogue(player!!, 258, "Who dares enter my home? You? A feeble traveller?").also { stage = 6 }
}
2 -> npcl(FacialExpression.FRIENDLY, "What do you want guard? I'm a busy man.").also { stage = 3 }
3 -> playerl(FacialExpression.FRIENDLY, "Of course sir.").also { stage = 4 }
4 -> npcl(FacialExpression.FRIENDLY, "In the last two hundred years, I have survived all horrors imaginable. Now it is my turn to cover this land in darkness. One day you shall see, all will quake on hearing my name.").also { stage = 5 }
5 -> npcl(FacialExpression.FRIENDLY, "Now leave me.").also { stage = END_DIALOGUE }
6 -> playerl(FacialExpression.ASKING, "Feeble?!").also { stage = 7 }
7 -> npcl(FacialExpression.ANGRY, "Get out! Whoever let you in shall be severely punished for this.").also { stage = END_DIALOGUE }
}
}
// 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 }
1 -> npcl(FacialExpression.EVIL_LAUGH, "Haha, well done, well done that was rather entertaining. I am the great General Khazard, and the two men you just 'saved' are my property.").also { stage = 2 }
2 -> playerl(FacialExpression.ANGRY, "They belong to nobody.").also { player!!.faceLocation(npc!!.location) }.also { stage = 3 }
3 -> npcl(FacialExpression.FRIENDLY, "Well, I suppose we could find some arrangement for their freedom... hmmm?").also { stage = 4 }
4 -> playerl(FacialExpression.ASKING, "What do you mean?").also { stage = 5 }
5 -> npcl(FacialExpression.FRIENDLY, "I'll let them go, but you must stay and fight for me. You'll make me double the gold if you manage to last a few fights.").also { stage = 6 }
6 -> npcl(FacialExpression.ANGRY_WITH_SMILE, "Guards! Take " + (if (player!!.isMale) "him" else "her") + " to the cells.").also { stage = 7 }
7 -> {
end()
setAttribute(player!!, "spawn-scorpion", true)
HengradCutscene(player!!).start()
}
}
}
// 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 }
}
}
(questStage == 88) -> {
when (stage) {
0 -> {
end()
HengradCutscene(player!!).start()
setAttribute(player!!, "spawn-scorpion", true)
}
}
}
// 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 }
1 -> sendDialogue(player!!, "From above you hear a voice..... 'Ladies and gentlemen! Today's second round of battle is between the outsider and Bouncer.'").also { stage = 2 }
2 -> {
end()
setAttribute(player!!, "spawn-bouncer", true)
BouncerCutscene(player!!).start()
}
}
}
// 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 -> playerl(FacialExpression.ANNOYED, "You agreed to let the Servils go if I stayed to fight.").also { stage = 2 }
2 -> npcl(FacialExpression.ANGRY_WITH_SMILE, "Indeed. I obviously underestimated you, although you still pale in comparsion to the might of General Khazard.").also { stage = 3 }
3 -> npcl(FacialExpression.NEUTRAL, "You shall see that I am not cowardlly enough to make false promises. They may go.").also { stage = 4 }
4 -> npcl(FacialExpression.EVIL_LAUGH, "You however have coused me much trouble today. You must remain here so that I may at least have the pleasure of killing you myself.").also { stage = 5 }
5 -> {
end()
setQuestStage(player!!, FightArena.FightArenaQuest, 97)
RegionManager.getNpc(player!!.location, GENERAL_KHAZARD_258, 15)
General.attack(player!!)
}
}
}
}
}
}
@@ -0,0 +1,56 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
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.lockInteractions
import core.api.questStage
import core.api.setQuestStage
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
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++ }
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++ }
5 -> playerl(FacialExpression.ASKING, " How long have you been here?").also { stage++ }
6 -> npcl(FacialExpression.FRIENDLY, " I've been in Khazard's prisons ever since I can remember. I was a child when his men kidnapped me. My whole life as been spent killing and fighting, all in the hope that, one day, I might escape.").also { stage++ }
7 -> playerl(FacialExpression.FRIENDLY, "Don't give up.").also { stage++ }
8 -> npcl(FacialExpression.FRIENDLY, "Thanks friend.").also { stage++ }
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 -> {
end()
ScorpionCutscene(player!!).start()
}
}
}
}
}
}
@@ -0,0 +1,58 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
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 core.api.questStage
import core.api.setAttribute
import core.api.setQuestStage
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.tools.END_DIALOGUE
class JeremyServilDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
val questName = "Fight Arena"
val questStage = questStage(player!!, questName)
npc = Jeremy
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++ }
1 -> npcl(FacialExpression.AFRAID, "Please " + (if (player!!.isMale) "Sir" else "Madam") + ", don't hurt me.").also { stage++ }
2 -> playerl(FacialExpression.SILENT, "Sshh. This uniform is a disguise. I'm here to help. Where do they keep the keys?").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "The guard always keeps hold of them.").also { stage++ }
4 -> playerl(FacialExpression.FRIENDLY, "Don't lose heart, I'll be back.").also { stage = END_DIALOGUE }.also { setQuestStage(player!!, FightArenaQuest, 40) }
}
}
// Talking to Jeremy after we get the keys.
(questStage in 88 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++ }
2 -> playerl(FacialExpression.NEUTRAL, "Ok, we'd better hurry.").also { stage = 3 }
3 -> {
end()
setAttribute(player!!, "spawn-ogre", true)
RescueCutscene(player!!).start()
}
}
}
// 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 }
}
}
}
}
}
@@ -0,0 +1,67 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import core.api.lockInteractions
import core.api.questStage
import core.api.sendPlayerDialogue
import core.api.setQuestStage
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.tools.END_DIALOGUE
import org.rs09.consts.NPCs
class JeremyServilRescuedDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
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 }
1 -> npcl("Thank you for saving my father.").also { stage = END_DIALOGUE }
}
}
// 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 }
1 -> npcl("Thanks traveller. I'm sorry that you too are now a subject of this arena.").also { stage = END_DIALOGUE }
}
}
// 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 }
1 -> npcl(FacialExpression.FRIENDLY, "Thank you, we are truly indebted to you.").also { stage = 2 }
2 -> {
end()
setQuestStage(player!!, FightArena.FightArenaQuest, 99)
}
}
}
// 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 -> npcl(FacialExpression.FRIENDLY, "Thank you, we are truly indebted to you.").also { stage = 2 }
2 -> {
end()
setQuestStage(player!!, FightArena.FightArenaQuest, 99)
}
}
}
}
}
}
@@ -0,0 +1,37 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
import core.api.questStage
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
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 }
1 -> npcl(FacialExpression.NEUTRAL, "You've incurred the anger of Khazard yourself now. He won't let any of us go easily.").also { stage = END_DIALOGUE }
}
}
// 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 }
}
}
}
}
}
@@ -0,0 +1,74 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
import content.region.kandarin.ardougne.quest.fightarena.FightArena
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.item.Item
import core.tools.END_DIALOGUE
import org.rs09.consts.Items
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 }
1 -> npcl(FacialExpression.FRIENDLY, "There you go, that's two gold coins.").also { stage = 2 }
2 -> 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 }
}
}
}
// Talking to Khazard barman
(questStage in 100 downTo 50) -> {
when (stage) {
0 -> playerl(FacialExpression.HAPPY, "Hello.").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Hi, what can I get you? We have a range of quality brews.").also { stage++ }
2 -> options("I'll have a beer please.", "I'd like a Khali brew please.", "Got any news?").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.NEUTRAL, "I'll have a beer please.").also { stage = 4 }
2 -> playerl(FacialExpression.NEUTRAL, "I'd like a Khali brew please.").also { stage = 7 }
3 -> playerl(FacialExpression.ASKING, "Got any news?").also { stage = 5 }
}
4 -> npcl(FacialExpression.FRIENDLY, "There you go, that's two gold coins.").also { stage = 8 }
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 }
} else {
playerl(FacialExpression.STRUGGLE, "Oh, I don't have enough money with me.").also { stage = END_DIALOGUE }
}
}
}
}
}
}
@@ -0,0 +1,102 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
import content.region.kandarin.ardougne.quest.fightarena.FightArena.Companion.FightArenaQuest
import core.api.questStage
import core.api.setQuestStage
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
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++ }
1 -> npcl(FacialExpression.SAD, "Oh I wish this broken cart was my only problem. *sob* I've got to find my family.. **sob**").also { stage++ }
2 -> options("I hope you can. good luck.", "Can I help you?").also { stage++ }
3 -> when (buttonID) {
1 -> playerl(FacialExpression.NEUTRAL, "I hope you can, good luck.").also { stage = END_DIALOGUE }
2 -> playerl(FacialExpression.FRIENDLY, "Can I help you?").also { stage++ }
}
4 -> npcl(FacialExpression.SAD, "Would you? Please?").also { stage++ }
5 -> npcl(FacialExpression.SAD, "I'm Lady Servil, and my husband is Sir Servil. We were travelling north together with our son Jeremy when we were ambushed by General Khazard's men.").also { stage++ }
6 -> playerl(FacialExpression.HALF_ASKING, "General Khazard?").also { stage++ }
7 -> npcl(FacialExpression.SAD, "He's been after me even since I declined his hand in marriage.").also { stage++ }
8 -> npcl(FacialExpression.SAD, "Now he's kidnapped my husband and son to fight in his battle arena to the south of here. I hate to think what he'll do to them. He's a sick and twisted man.").also { stage++ }
9 -> playerl(FacialExpression.FRIENDLY, "I'll try my best to return your family.").also { stage++ }
10 -> npcl(FacialExpression.SAD, "Please do. My family is wealthy and can reward you handsomely. I'll be waiting here for you.").also { stage = END_DIALOGUE }.also { setQuestStage(player!!, FightArenaQuest, 10) }
}
}
// Talking to Lady Servil after starting the quest.
(questStage == 10) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello Lady Servil.").also { stage++ }
1 -> npcl(FacialExpression.SAD, "Brave traveller, please... bring back my family.").also { stage = END_DIALOGUE }
}
}
// Talking to Lady Servil after getting armour.
(questStage == 20) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello Lady Servil.").also { stage++ }
1 -> npcl(FacialExpression.WORRIED, "Have you had any luck with freeing my family?").also { stage++ }
2 -> playerl(FacialExpression.HAPPY, "I've managed to get a guard's uniform, hopefully I can infiltrate the arena.").also { stage++ }
3 -> npcl(FacialExpression.SAD, "Please hurry.").also { stage = END_DIALOGUE }
}
}
// 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++ }
1 -> npcl(FacialExpression.ASKING, "And my family?").also { stage++ }
2 -> playerl(FacialExpression.NEUTRAL, "I'm working on it.").also { stage++ }
3 -> npcl(FacialExpression.SAD, "Please hurry.").also { stage = END_DIALOGUE }
}
}
// 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++ }
1 -> npcl(FacialExpression.WORRIED, "Oh no, they won't stand a chance. Please go back and help.").also { stage = END_DIALOGUE }
}
}
// Talking to Lady Servil to complete the quest and get reward.
(questStage == 99) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Lady Servil.").also { stage++ }
1 -> npcl(FacialExpression.AMAZED, "You're alive, I thought Khazard's men had taken you.").also { stage++ }
2 -> npcl(FacialExpression.HAPPY, "My son and husband are safe and recovering at home. Without you they would certainly be dead. I am truly grateful for your service.").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "All I can offer in return is material wealth. Please take these coins as a sign of my gratitude.").also {
player!!.questRepository.getQuest("Fight Arena").finish(player).also { setQuestStage(player!!, FightArenaQuest, 100) }
}
}
}
// Talking to Lady Servil after the complete the quest.
(questStage == 100) -> {
when (stage) {
0 -> playerl(FacialExpression.FRIENDLY, "Hello Servil.").also { stage++ }
1 -> npcl(FacialExpression.FRIENDLY, "Oh hello my dear. My husband and son are resting while I wait for the cart fixer.").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "I hope he's not too long.").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "Thanks again for everything.").also { stage = END_DIALOGUE }
}
}
}
}
}
@@ -0,0 +1,90 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs
import content.region.kandarin.ardougne.quest.fightarena.FightArena.Companion.FightArenaQuest
import core.api.*
import core.game.dialogue.DialogueFile
import core.game.dialogue.FacialExpression
import core.game.node.entity.npc.NPC
import core.game.node.item.Item
import core.tools.END_DIALOGUE
import org.rs09.consts.Items.KHALI_BREW_77
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++ }
1 -> npcl(FacialExpression.FRIENDLY, "Erm.. yes.. quite right.").also { stage++ }
2 -> npcl(FacialExpression.FRIENDLY, "Have you come to laugh at the fight slaves? I used to really enjoy it, but after a while they become quite boring. ").also { stage++ }
3 -> npcl(FacialExpression.FRIENDLY, "Now I just want a decent drink. Mind you, too much Khali brew and I'll fall asleep.").also { stage = END_DIALOGUE }.also { setQuestStage(player!!, FightArenaQuest, 50) }
}
}
// 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++ }
1 -> npcl(FacialExpression.DRUNK, "Please, leave me alone. I'm sure the walls never used to sway that much.").also { stage = END_DIALOGUE }
}
}
// 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++ }
1 -> npcl(FacialExpression.NEUTRAL, "Bored, bored, bored. You'd think the slaves would be more entertaining? Selfish the lot of them.").also { stage++ }
2 -> playerl(FacialExpression.FRIENDLY, "Do you still fancy a drink?").also { stage++ }
3 -> npcl(FacialExpression.HAPPY, "I really shouldn't... oh... ok then just the one.").also { stage++ }
4 -> if (player!!.inventory.containItems(KHALI_BREW_77)) {
sendItemDialogue(player!!, KHALI_BREW_77, "You hand a bottle of Khali brew to the guard. He takes a mouthful of the drink.").also { stage = 5 }
} else {
npcl(FacialExpression.NEUTRAL, "Now I just want a decent drink. Mind you, too much Khali brew and I'll fall asleep.").also { stage = END_DIALOGUE }
}
5 -> npcl(FacialExpression.DRUNK, "Blimey this stuff is pretty good. It's not too strong is it?").also { stage++ }
6 -> playerl(FacialExpression.HALF_GUILTY, "No, not at all. You'll be fine.").also { stage++ }
7 -> sendDialogue(player!!, "The guard quickly finishes the rest of the bottle and begins to sway slightly.").also { stage++ }
8 -> npcl(FacialExpression.HAPPY, "That is some gooood stuff... yeah... wooh yeah!").also { stage++ }
9 -> playerl(FacialExpression.HALF_WORRIED, "Are you alright?").also { stage++ }
10 -> npcl(FacialExpression.DRUNK, "Yeesshh, hiccup! Oooh, maybe I sshould relax for a while.").also { stage++ }
11 -> playerl(FacialExpression.NEUTRAL, "Good idea. I'll look after the prisoners.").also { stage++ }
12 -> npcl(FacialExpression.DRUNK, "Yeesh, yes that shounds reasonable. Here, hiccup', take the keysch. Any trouble, you give... you givem a good beating.").also { stage++ }
13 -> playerl(FacialExpression.NEUTRAL, "No problem. I'll keep them in line.").also { stage = 14 }
14 -> {
end()
player!!.inventory.remove(Item(KHALI_BREW_77))
player!!.inventory.add(Item(KHAZARD_CELL_KEYS_76))
sendMessage(player!!, "You pick up the keys from the table.")
player!!.questRepository.getQuest("Fight Arena").setStage(player, 68).also { stage = END_DIALOGUE }
}
}
}
// Talking to Lazy Khazard Guard ~
(questStage in 68..100) -> {
when (stage) { // after we got the keys.
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.
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 }
2 -> npcl(FacialExpression.DRUNK, "What?! You're foolish...").also { stage = 3 }
3 -> npcl(FacialExpression.DRUNK, "...and I'm drunk. Here, take my spare set.").also { player!!.inventory.add(Item(KHAZARD_CELL_KEYS_76)) }.also { stage = END_DIALOGUE }
}
}
}
}
}
@@ -0,0 +1,65 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
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
import core.game.node.entity.player.Player
import core.game.system.task.Pulse
import core.game.world.GameWorld
import core.game.world.map.Location
import core.plugin.Initializable
import org.rs09.consts.NPCs
@Initializable
class BouncerNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
var clearTime = 0
override fun construct(id: Int, location: Location, vararg objects: Any): AbstractNPC {
return BouncerNPC(id, location)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.BOUNCER_269)
}
override fun handleTickActions() {
super.handleTickActions()
if (clearTime++ > 144) poofClear(this)
}
companion object {
fun spawnBouncer(player: Player) {
val bouncer = BouncerNPC(NPCs.BOUNCER_269)
bouncer.location = location(2604, 3160, 0)
bouncer.isWalks = true
bouncer.isAggressive = true
bouncer.isActive = false
if (bouncer.asNpc() != null && bouncer.isActive && getAttribute(player, "spawn-bouncer", false)) {
bouncer.properties.teleportLocation = bouncer.properties.spawnLocation
}
bouncer.isActive = true
GameWorld.Pulser.submit(object : Pulse(2, bouncer) {
override fun pulse(): Boolean {
bouncer.init()
bouncer.attack(player)
return true
}
})
}
}
override fun finalizeDeath(killer: Entity?) {
if (killer is Player) {
val quest = "Fight Arena"
if (questStage(killer, quest) >= 89) {
setQuestStage(killer, FightArena.FightArenaQuest, 91)
}
removeAttribute(killer, "spawn-bouncer")
openDialogue(killer, GeneralKhazardDialogue())
}
clear()
super.finalizeDeath(killer)
}
}
@@ -0,0 +1,44 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
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 core.api.openDialogue
import core.api.questStage
import core.api.setQuestStage
import core.game.node.entity.Entity
import core.game.node.entity.npc.AbstractNPC
import core.game.node.entity.player.Player
import core.game.world.map.Location
import core.plugin.Initializable
import org.rs09.consts.NPCs
@Initializable
class GeneralNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
override fun construct(id: Int, location: Location, vararg objects: Any): AbstractNPC {
return GeneralNPC(id, location)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.GENERAL_KHAZARD_258)
}
override fun handleTickActions() {
super.handleTickActions()
General.asNpc().isRespawn = true
General.respawnTick = 10
}
override fun finalizeDeath(killer: Entity?) {
if (killer is Player) {
val quest = "Fight Arena"
if (questStage(killer, quest) == 97) {
setQuestStage(killer, FightArena.FightArenaQuest, 98)
}
openDialogue(killer, JeremyServilRescuedDialogue())
}
super.finalizeDeath(killer)
}
}
@@ -0,0 +1,68 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
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
import core.game.node.entity.player.Player
import core.game.system.task.Pulse
import core.game.world.GameWorld
import core.game.world.map.Location
import core.plugin.Initializable
import org.rs09.consts.NPCs
@Initializable
class KhazardOgreNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
var clearTime = 0
override fun construct(id: Int, location: Location, vararg objects: Any): AbstractNPC {
return KhazardOgreNPC(id, location)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_OGRE_270)
}
override fun handleTickActions() {
super.handleTickActions()
if (clearTime++ > 144) poofClear(this)
}
companion object {
fun spawnOgre(player: Player) {
val ogre = KhazardOgreNPC(NPCs.KHAZARD_OGRE_270)
ogre.location = location(2603, 3166, 0)
ogre.isWalks = true
ogre.isAggressive = true
ogre.isActive = false
if (ogre.asNpc() != null && ogre.isActive && getAttribute(player, "spawn-ogre", false)) {
ogre.properties.teleportLocation = ogre.properties.spawnLocation
}
ogre.isActive = true
GameWorld.Pulser.submit(object : Pulse(2, ogre) {
override fun pulse(): Boolean {
ogre.init()
ogre.attack(player)
registerHintIcon(player, ogre)
return true
}
})
}
}
override fun finalizeDeath(killer: Entity?) {
if (killer is Player) {
val quest = "Fight Arena"
if (questStage(killer, quest) == 68 || questStage(killer, quest) == 88) {
setQuestStage(killer, FightArena.FightArenaQuest, 72)
}
clearHintIcon(killer)
removeAttribute(killer, "spawn-ogre")
openDialogue(killer, GeneralKhazardDialogue())
}
clear()
super.finalizeDeath(killer)
}
}
@@ -0,0 +1,67 @@
package content.region.kandarin.ardougne.quest.fightarena.npcs.enemies
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
import core.game.node.entity.player.Player
import core.game.system.task.Pulse
import core.game.world.GameWorld
import core.game.world.map.Location
import core.plugin.Initializable
import org.rs09.consts.NPCs
@Initializable
class KhazardScorpionNPC(id: Int = 0, location: Location? = null) : AbstractNPC(id, location) {
var clearTime = 0
override fun construct(id: Int, location: Location, vararg objects: Any): AbstractNPC {
return KhazardScorpionNPC(id, location)
}
override fun getIds(): IntArray {
return intArrayOf(NPCs.KHAZARD_SCORPION_271)
}
override fun handleTickActions() {
super.handleTickActions()
if (clearTime++ > 144) poofClear(this)
}
companion object {
fun spawnScorpion(player: Player) {
val scorpion = KhazardScorpionNPC(NPCs.KHAZARD_SCORPION_271)
scorpion.location = location(2604, 3159, 0)
scorpion.isWalks = true
scorpion.isAggressive = true
scorpion.isActive = false
if (scorpion.asNpc() != null && scorpion.isActive && getAttribute(player, "spawn-scorpion", false)) {
scorpion.properties.teleportLocation = scorpion.properties.spawnLocation
}
scorpion.isActive = true
GameWorld.Pulser.submit(object : Pulse(2, scorpion) {
override fun pulse(): Boolean {
scorpion.init()
scorpion.attack(player)
return true
}
})
}
}
override fun finalizeDeath(killer: Entity?) {
if (killer is Player) {
val quest = "Fight Arena"
if (questStage(killer, quest) == 88) {
setQuestStage(killer, FightArena.FightArenaQuest, 89)
}
removeAttribute(killer, "spawn-scorpion")
openDialogue(killer, GeneralKhazardDialogue())
}
clear()
super.finalizeDeath(killer)
}
}