mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Implemented Death Plateau quest
This commit is contained in:
parent
c7e8c54068
commit
2f4781e4ce
24 changed files with 1902 additions and 388 deletions
|
|
@ -896,12 +896,12 @@
|
||||||
{
|
{
|
||||||
"id": "3725",
|
"id": "3725",
|
||||||
"replaceId": "3727",
|
"replaceId": "3727",
|
||||||
"fence": "false",
|
"fence": "true",
|
||||||
"metal": "false"
|
"metal": "false"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "3726",
|
"id": "3726",
|
||||||
"replaceId": "3727",
|
"replaceId": "3728",
|
||||||
"fence": "true",
|
"fence": "true",
|
||||||
"metal": "false"
|
"metal": "false"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11080,6 +11080,27 @@
|
||||||
"range_level": "1",
|
"range_level": "1",
|
||||||
"attack_level": "33"
|
"attack_level": "33"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"examine": "An off-duty Burthorpe Castle guard.",
|
||||||
|
"melee_animation": "0",
|
||||||
|
"range_animation": "0",
|
||||||
|
"defence_animation": "0",
|
||||||
|
"magic_animation": "0",
|
||||||
|
"death_animation": "0",
|
||||||
|
"name": "Harold",
|
||||||
|
"defence_level": "1",
|
||||||
|
"safespot": null,
|
||||||
|
"lifepoints": "10",
|
||||||
|
"strength_level": "1",
|
||||||
|
"id": "1078",
|
||||||
|
"range_level": "1",
|
||||||
|
"attack_level": "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"examine": "Head servant for Prince Anlaf.",
|
||||||
|
"name": "Eohric",
|
||||||
|
"id": "1080"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"examine": "A servant for Prince Anlaf.",
|
"examine": "A servant for Prince Anlaf.",
|
||||||
"melee_animation": "0",
|
"melee_animation": "0",
|
||||||
|
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
package content.region.asgarnia.burthorpe.dialogue;
|
|
||||||
|
|
||||||
import core.game.dialogue.DialoguePlugin;
|
|
||||||
import core.game.dialogue.FacialExpression;
|
|
||||||
import core.game.node.entity.npc.NPC;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the denulth dialogue plugin.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class DenulthDialogue extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code DenulthDialogue} {@code Object}.
|
|
||||||
*/
|
|
||||||
public DenulthDialogue() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code DenulthDialogue} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public DenulthDialogue(Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new DenulthDialogue(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC) args[0];
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hello!");
|
|
||||||
stage = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Welcome back friend!");
|
|
||||||
stage = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "How goes your fight with trolls?");
|
|
||||||
stage = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Very good! We are winning.");
|
|
||||||
stage = 3;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Good luck!");
|
|
||||||
stage = 4;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 1060 };
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package content.region.asgarnia.burthorpe.dialogue
|
||||||
|
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.DenulthDialogueFile
|
||||||
|
import core.api.openDialogue
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Denulth main dialogue.
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
@Initializable
|
||||||
|
class DenulthDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
// Fallback to default. Always the start of Death Plateau
|
||||||
|
openDialogue(player!!, DenulthDialogueFile(), npc)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return DenulthDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.DENULTH_1060)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
package content.region.asgarnia.burthorpe.dialogue;
|
|
||||||
|
|
||||||
import core.game.dialogue.DialoguePlugin;
|
|
||||||
import core.game.dialogue.FacialExpression;
|
|
||||||
import core.game.node.entity.npc.NPC;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represnts the dialogue plugin used for dunstan.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class DunstanDialogue extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code DunstanDialogue} {@code Object}.
|
|
||||||
*/
|
|
||||||
public DunstanDialogue() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code DunstanDialogue} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public DunstanDialogue(Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new DunstanDialogue(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC) args[0];
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hi!");
|
|
||||||
stage = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hi! Did you want something?");
|
|
||||||
stage = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
interpreter.sendOptions("Select an Option", "Is it OK if I use your anvil?", "Nothing, thanks.");
|
|
||||||
stage = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
switch (buttonId) {
|
|
||||||
case 1:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Is it OK if I use your anvil?");
|
|
||||||
stage = 10;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Nothing, thanks.");
|
|
||||||
stage = 20;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "So you're a smithy are you?");
|
|
||||||
stage = 11;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "I dabble.");
|
|
||||||
stage = 12;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "A fellow smith is welcome to use my anvil!");
|
|
||||||
stage = 13;
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Thanks!");
|
|
||||||
stage = 14;
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 1082 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package content.region.asgarnia.burthorpe.dialogue
|
||||||
|
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.DunstanDialogueFile
|
||||||
|
import core.api.isQuestInProgress
|
||||||
|
import core.api.openDialogue
|
||||||
|
import core.api.questStage
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dunstan main dialogue.
|
||||||
|
* @author 'ovenbread
|
||||||
|
*
|
||||||
|
* https://www.youtube.com/watch?v=gbqcJp99Zd8
|
||||||
|
* https://www.youtube.com/watch?v=ujtIALS1L7A
|
||||||
|
*/
|
||||||
|
@Initializable
|
||||||
|
class DunstanDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
if (isQuestInProgress(player!!, DeathPlateau.questName, 21, 24)) {
|
||||||
|
// Call the dialogue file for Dunstan from the deathplateau quest folder.
|
||||||
|
openDialogue(player!!, DunstanDialogueFile(), npc)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Default
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hi! Did you want something??").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic(FacialExpression.THINKING, "Is it OK if I use your anvil?", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Nothing, thanks.", END_DIALOGUE),
|
||||||
|
// More dialogues here (Sleds, Climbing Boots, Troll Stronghold)
|
||||||
|
)
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY, "So you're a smithy are you?").also { stage++ }
|
||||||
|
11 -> playerl(FacialExpression.FRIENDLY, "I dabble.").also { stage++ }
|
||||||
|
12 -> npcl(FacialExpression.FRIENDLY, "A fellow smith is welcome to use my anvil!").also { stage++ }
|
||||||
|
13 -> playerl(FacialExpression.FRIENDLY, "Thanks!").also { stage++ }
|
||||||
|
14 -> npcl(FacialExpression.FRIENDLY, "Anything else before I get on with my work?").also { stage = 2 }
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun newInstance(player: Player): DialoguePlugin {
|
||||||
|
return DunstanDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.DUNSTAN_1082)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
package content.region.asgarnia.burthorpe.dialogue
|
||||||
|
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.EohricDialogueFile
|
||||||
|
import core.api.openDialogue
|
||||||
|
import core.api.questStage
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Eohric main dialogue.
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
@Initializable
|
||||||
|
class EohricDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
if (questStage(player!!, DeathPlateau.questName) >= 5) {
|
||||||
|
// Call the dialogue file for Eohric from the deathplateau quest folder.
|
||||||
|
openDialogue(player!!, EohricDialogueFile(), npc)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Fallback to default.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.HALF_GUILTY, "Hi!").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.ASKING, "Hello. Can I help?").also { stage++ }
|
||||||
|
2 -> options("What is this place?", "That's quite an outfit.", "Goodbye.").also { stage++ }
|
||||||
|
3 -> when (buttonId) {
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "This is Burthorpe Castle, home to His Royal Highness Prince Anlaf, heir to the throne of Asgarnia.").also { stage = 10 }
|
||||||
|
2 -> npcl(FacialExpression.HAPPY, "Why, thank you. I designed it myself. I've always found purple such a cheerful colour!").also { stage = 2 }
|
||||||
|
3 -> player(FacialExpression.FRIENDLY, "Goodbye.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
10 -> npc(FacialExpression.FRIENDLY, "No doubt you're impressed.").also { stage++ }
|
||||||
|
11 -> options("Where is the prince?", "Goodbye.").also { stage++ }
|
||||||
|
12 -> when (buttonId) {
|
||||||
|
1 -> npcl(FacialExpression.SUSPICIOUS, "I cannot disclose the prince's exact whereabouts for fear of compromising his personal safety.").also { stage = 20 }
|
||||||
|
2 -> player(FacialExpression.FRIENDLY, "Goodbye.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "But rest assured that he is working tirelessly to maintain the safety and wellbeing of Burthorpe's people.").also { stage = 2 }
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return EohricDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.EOHRIC_1080)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package content.region.asgarnia.burthorpe.dialogue
|
||||||
|
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.HaroldDialogueFile
|
||||||
|
import core.api.*
|
||||||
|
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.game.world.update.flag.context.Animation
|
||||||
|
import core.game.world.update.flag.context.Graphics
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.Animations
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Harold main dialogue.
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
@Initializable
|
||||||
|
class HaroldDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
if (isQuestInProgress(player!!, DeathPlateau.questName, 10, 29)) {
|
||||||
|
// Call the dialogue file for Harold from the deathplateau quest folder.
|
||||||
|
openDialogue(player!!, HaroldDialogueFile(), npc)
|
||||||
|
}
|
||||||
|
// Fallback to default.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.FRIENDLY, "Hi.").also { stage++ }
|
||||||
|
2 -> player(FacialExpression.FRIENDLY, "Can I buy you a drink?").also { stage++ }
|
||||||
|
3 -> npc(FacialExpression.HAPPY, "Now you're talking! An Asgarnian Ale, please!").also { stage++ }
|
||||||
|
4 -> {
|
||||||
|
if (removeItem(player!!, Items.ASGARNIAN_ALE_1905)) {
|
||||||
|
sendMessage(player!!, "You give Harold an Asgarnian Ale.")
|
||||||
|
sendItemDialogue(player!!, Items.ASGARNIAN_ALE_1905, "You give Harold an Asgarnian Ale.").also { stage++ }
|
||||||
|
} else {
|
||||||
|
player(FacialExpression.FRIENDLY, "I'll go and get you one.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
5 -> {
|
||||||
|
end()
|
||||||
|
animate(npc!!, Animation(Animations.HUMAN_EATTING_829), true)
|
||||||
|
runTask(npc!!, 3) {
|
||||||
|
npc(FacialExpression.FRIENDLY, "*burp*").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return HaroldDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.HAROLD_1078)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.addItemOrDrop
|
||||||
|
import core.api.getAttribute
|
||||||
|
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.game.world.map.Location
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Death Plateau Quest
|
||||||
|
* @author bushtail
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
@Initializable
|
||||||
|
class DeathPlateau : Quest("Death Plateau",44, 43, 1, 314, 0, 1, 80) {
|
||||||
|
companion object {
|
||||||
|
const val questName = "Death Plateau"
|
||||||
|
}
|
||||||
|
override fun drawJournal(player: Player?, stage: Int) {
|
||||||
|
super.drawJournal(player, stage)
|
||||||
|
var line = 12
|
||||||
|
var stage = getStage(player)
|
||||||
|
|
||||||
|
var started = player?.questRepository?.getStage(questName)!! > 0
|
||||||
|
|
||||||
|
if(!started){
|
||||||
|
line(player, "I can start this quest by speaking to !!Denulth?? who is in his", line++)
|
||||||
|
line(player, "tent at the !!Imperial Guard camp?? in !!Burthorpe", line++)
|
||||||
|
} else {
|
||||||
|
if(stage >= 5) {
|
||||||
|
when(stage) {
|
||||||
|
in 1..18 -> {
|
||||||
|
line(player,"I have offered to help !!Denulth?? by finding !!another way?? up",line++,)
|
||||||
|
line(player,"!!Death Plateau.?? I also need to find the !!combination?? to the",line++,)
|
||||||
|
line(player,"!!equipment room?? and !!unlock?? the door.",line++,)
|
||||||
|
}
|
||||||
|
// Technically this part is to be done in parallel with the ball mechanism part above.
|
||||||
|
in 19..99 -> {
|
||||||
|
line(player,"I have offered to help !!Denulth?? by finding !!another way?? up",line++,)
|
||||||
|
line(player,"!!Death Plateau.??",line++,)
|
||||||
|
line(player,"",line++,)
|
||||||
|
line(player,"I have found the combination to the equipment room and",line++,stage>18)
|
||||||
|
line(player,"unlocked the door.",line++,stage>18)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(stage >= 10) {
|
||||||
|
when(stage) {
|
||||||
|
10 -> {
|
||||||
|
line(player,"The equipment room guard is staying at the local inn, the",line++,stage>18)
|
||||||
|
line(player,"!!Toad and Chicken.??",line++,stage>18)
|
||||||
|
}
|
||||||
|
in 11 .. 12 -> {
|
||||||
|
line(player,"The equipment room guard is staying at the local inn, the",line++,stage>18)
|
||||||
|
line(player,"!!Toad and Chicken.?? the guard wouldn't talk to me!",line++,stage>18)
|
||||||
|
}
|
||||||
|
in 13 .. 14 -> {
|
||||||
|
line(player,"The equipment room guard is staying at the local inn, the",line++,stage>18)
|
||||||
|
line(player,"!!Toad and Chicken.?? the guard wouldn't talk to me! I bought",line++,stage>18)
|
||||||
|
line(player,"the guard a drink and he seemed more helpful.",line++,stage>18)
|
||||||
|
}
|
||||||
|
in 15..99 -> {
|
||||||
|
line(player,"The equipment room guard is staying at the local inn, the",line++,stage>18)
|
||||||
|
line(player,"!!Toad and Chicken.?? the guard wouldn't talk to me! I bought",line++,stage>18)
|
||||||
|
line(player,"the guard a drink and he seemed more helpful. I gambled",line++,stage>18)
|
||||||
|
line(player,"with the guard until he ran out of money, he wrote out an !!IOU.??",line++,stage>18)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(stage >= 16) {
|
||||||
|
when(stage) {
|
||||||
|
16 -> {
|
||||||
|
line(player,"It turned out the IOU was written on the back of the",line++,stage>18)
|
||||||
|
line(player,"combination!",line++,stage>18)
|
||||||
|
}
|
||||||
|
in 17..99 -> {
|
||||||
|
line(player,"It turned out the IOU was written on the back of the",line++,stage>18)
|
||||||
|
line(player,"combination! I put the stone balls in the right places on the",line++,stage>18)
|
||||||
|
line(player,"stone mechanism and unlocked the door!",line++,stage>18)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(stage >= 20) {
|
||||||
|
when(stage) {
|
||||||
|
20 -> {
|
||||||
|
line(player,"!!Saba?? says that there is a !!sherpa?? living !!nearby?? that may",line++,false)
|
||||||
|
line(player,"know another way up Death Plateau.",line++,false)
|
||||||
|
}
|
||||||
|
21 -> {
|
||||||
|
line(player, "I found the !!sherpa's?? house.", line++, true)
|
||||||
|
// Note: You must give him the 21 items in one go. The items will cross out when you have them in your inventory.
|
||||||
|
line(player, "!!Tenzing?? will show me a !!secret way?? up Death Plateau if I get", line++, false)
|
||||||
|
line(player, "him some items:", line++, false)
|
||||||
|
line(player, "Ten loaves of bread.", line++, getAttribute(player, "deathplateau:bread", false))
|
||||||
|
line(player, "Ten cooked trout.", line++, getAttribute(player, "deathplateau:trout", false))
|
||||||
|
line(player, "Spiked boots.", line++, getAttribute(player, "deathplateau:boots", false))
|
||||||
|
line++
|
||||||
|
line(player, "!!Tenzing?? gave me his !!climbing boots??, I need to take them to", line++, false)
|
||||||
|
line(player, "!!Dunstan?? in !!Burthorpe?? for the !!spikes??", line++, false)
|
||||||
|
}
|
||||||
|
24 -> {
|
||||||
|
line(player, "I found the !!sherpa's?? house. I gave Tenzing the ten loaves", line++, true)
|
||||||
|
line(player, "of bread, ten cooked trout and the Spiked boots. Tenzing", line++, true)
|
||||||
|
line(player, "has given me a map of the secret way.", line++, true)
|
||||||
|
line++
|
||||||
|
line(player,"I need to !!check?? that the !!secret way?? is !!safe?? for the !!Imperial??", line++, false)
|
||||||
|
line(player,"!!Guard?? to use.", line++, false)
|
||||||
|
}
|
||||||
|
25 -> {
|
||||||
|
line(player, "I found the !!sherpa's?? house. I gave Tenzing the ten loaves", line++, true)
|
||||||
|
line(player, "of bread, ten cooked trout and the Spiked boots. Tenzing", line++, true)
|
||||||
|
line(player, "has given me a map of the secret way.", line++, true)
|
||||||
|
line++
|
||||||
|
line(player,"I need to !!check?? that the !!secret way?? is !!safe?? for the !!Imperial??", line++, false)
|
||||||
|
line(player,"!!Guard?? to use.", line++, false)
|
||||||
|
}
|
||||||
|
in 26 .. 99 -> {
|
||||||
|
line(player, "I found the !!sherpa's?? house. I gave Tenzing the ten loaves", line++, true)
|
||||||
|
line(player, "of bread, ten cooked trout and the Spiked boots. Tenzing", line++, true)
|
||||||
|
line(player, "has given me a map of the secret way. I checked the", line++, true)
|
||||||
|
line(player, "secret way and it is safe for the Imperial Guard to use.", line++, true)
|
||||||
|
line++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
when(stage) {
|
||||||
|
in 22 .. 23 -> {
|
||||||
|
line(player, "!!Dunstan?? will help me if I get his !!son signed up?? for the", line++, false)
|
||||||
|
line(player, "!!Imperial Guard??. I will need an !!Iron bar?? for the boots", line++, false)
|
||||||
|
}
|
||||||
|
in 24 .. 99 -> {
|
||||||
|
line(player,"I have given Dunstan the certificate to prove that his son", line++, true)
|
||||||
|
line(player,"has been signed up for the Imperial Guard. Dunstan made", line++, true)
|
||||||
|
line(player, "me the Spiked boots.", line++, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(stage >= 30) {
|
||||||
|
line(player,"I should go and tell !!Denulth?? I've completed my mission.", line++, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun finish(player: Player) {
|
||||||
|
var ln = 10
|
||||||
|
super.finish(player)
|
||||||
|
player.packetDispatch.sendString("You have completed the Death Plateau Quest!", 277, 4)
|
||||||
|
player.packetDispatch.sendItemZoomOnInterface(Items.STEEL_CLAWS_3097, 240, 277, 5)
|
||||||
|
|
||||||
|
drawReward(player,"1 Quest Point", ln++)
|
||||||
|
drawReward(player,"3,000 Attack XP", ln++)
|
||||||
|
drawReward(player,"Some Steel Claws", ln++)
|
||||||
|
drawReward(player,"Ability to make Claws", ln++)
|
||||||
|
|
||||||
|
addItemOrDrop(player, Items.STEEL_CLAWS_3097, 1)
|
||||||
|
player.skills.addExperience(Skills.ATTACK, 3000.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun newInstance(`object`: Any?): Quest {
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.getScenery
|
||||||
|
import core.api.questStage
|
||||||
|
import core.api.sendDialogue
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.global.action.DoorActionHandler
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
class DeathPlateauDoorDialogueFile(val door: Int) : DialogueFile() {
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
if(door == 1) {
|
||||||
|
npc = NPC(NPCs.HAROLD_1078)
|
||||||
|
when (stage) {
|
||||||
|
0 -> sendDialogue(player!!, "You knock on the door.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Come on in!").also { stage++ }
|
||||||
|
2 -> {
|
||||||
|
end()
|
||||||
|
DoorActionHandler.handleAutowalkDoor(player, getScenery(2906, 3543, 1))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(door == 2) {
|
||||||
|
npc = NPC(NPCs.TENZING_1071)
|
||||||
|
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
in 0 .. 19 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> sendDialogue(player!!, "You knock on the door.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "No milk today! Thank you!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
20 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> sendDialogue(player!!, "You knock on the door.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "No milk today! Thank you!").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "I'm not the milkman, I need your help!").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "Oh...OK. You'd better come in then.").also { stage++ }
|
||||||
|
4 -> {
|
||||||
|
end()
|
||||||
|
DoorActionHandler.handleAutowalkDoor(player, getScenery(2823, 3555, 0))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 21 .. 100 -> {
|
||||||
|
end()
|
||||||
|
DoorActionHandler.handleAutowalkDoor(player, getScenery(2823, 3555, 0))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(door == 3) {
|
||||||
|
npc = NPC(NPCs.TENZING_1071)
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
in 0..24 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> npcl(FacialExpression.FRIENDLY, "Where do you think you're going? This is private property!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 25..100 -> {
|
||||||
|
end()
|
||||||
|
DoorActionHandler.handleAutowalkDoor(player, getScenery(2820, 3558, 0))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.global.action.DoorActionHandler
|
||||||
|
import core.game.interaction.IntType
|
||||||
|
import core.game.interaction.InteractionListener
|
||||||
|
import core.game.node.item.GroundItemManager
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
import org.rs09.consts.Scenery
|
||||||
|
|
||||||
|
class DeathPlateauInteractionListener : InteractionListener {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val stoneBalls = intArrayOf(
|
||||||
|
Items.STONE_BALL_3109, // Red
|
||||||
|
Items.STONE_BALL_3110, // Blue
|
||||||
|
Items.STONE_BALL_3111, // Yellow
|
||||||
|
Items.STONE_BALL_3112, // Purple
|
||||||
|
Items.STONE_BALL_3113 // Green
|
||||||
|
)
|
||||||
|
val stoneMechanisms = intArrayOf(
|
||||||
|
Scenery.STONE_MECHANISM_3676, // 4 Outer stone plates
|
||||||
|
Scenery.STONE_MECHANISM_3677 // 2 Inner stone plates
|
||||||
|
)
|
||||||
|
}
|
||||||
|
override fun defineListeners() {
|
||||||
|
on(Scenery.DOOR_3747, SCENERY, "open") { player, _ ->
|
||||||
|
// Harold's Door
|
||||||
|
if (player.location == location(2906, 3543, 1)) {
|
||||||
|
openDialogue(player, DeathPlateauDoorDialogueFile(1))
|
||||||
|
} else {
|
||||||
|
DoorActionHandler.handleAutowalkDoor(player, getScenery(2906, 3543, 1))
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
on(Scenery.DOOR_3745, SCENERY, "open") { player, node ->
|
||||||
|
if (node.location == location(2823, 3555, 0)) {
|
||||||
|
// 1st Door to Tenzing
|
||||||
|
openDialogue(player, DeathPlateauDoorDialogueFile(2))
|
||||||
|
} else if (node.location == location(2820, 3558, 0)) {
|
||||||
|
// 2nd Door to chicken pen
|
||||||
|
openDialogue(player, DeathPlateauDoorDialogueFile(3))
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
on(Items.IOU_3103, ITEM, "read") { player, _ ->
|
||||||
|
openDialogue(player, IOUNoteDialogueFile())
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
on(Items.COMBINATION_3102, ITEM, "read") { player, _ ->
|
||||||
|
openInterface(player, 220)
|
||||||
|
setInterfaceText(player, "<col=3D1E00>Red is North of Blue. Yellow is South of Purple.", 220, 7)
|
||||||
|
setInterfaceText(player, "<col=3D1E00>Green is North of Purple. Blue is West of", 220, 8)
|
||||||
|
setInterfaceText(player, "<col=3D1E00>Yellow. Purple is East of Red.", 220, 9)
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
onUseWith(IntType.SCENERY, stoneBalls, *stoneMechanisms) { player, used, with ->
|
||||||
|
val stoneBall = used.asItem()
|
||||||
|
val stoneMechanism = with.asScenery()
|
||||||
|
|
||||||
|
// Place item on table
|
||||||
|
if (removeItem(player, stoneBall)) {
|
||||||
|
produceGroundItem(player, stoneBall.id, 1, stoneMechanism.location)
|
||||||
|
}
|
||||||
|
// Check if order was correct
|
||||||
|
/**
|
||||||
|
* Facing north
|
||||||
|
* NONE [2894, 3564, 0] [2895, 3564, 0] GREEN
|
||||||
|
* RED [2894, 3563, 0] [2895, 3563, 0] PURPLE
|
||||||
|
* BLUE [2894, 3562, 0] [2895, 3562, 0] YELLOW
|
||||||
|
*/
|
||||||
|
if (GroundItemManager.get(Items.STONE_BALL_3109, location(2894, 3563, 0), player) != null &&
|
||||||
|
GroundItemManager.get(Items.STONE_BALL_3110, location(2894, 3562, 0), player) != null &&
|
||||||
|
GroundItemManager.get(Items.STONE_BALL_3111, location(2895, 3562, 0), player) != null &&
|
||||||
|
GroundItemManager.get(Items.STONE_BALL_3112, location(2895, 3563, 0), player) != null &&
|
||||||
|
GroundItemManager.get(Items.STONE_BALL_3113, location(2895, 3564, 0), player) != null) {
|
||||||
|
if (questStage(player, DeathPlateau.questName) == 16) {
|
||||||
|
sendMessage(player, "The equipment room door has unlocked.")
|
||||||
|
setQuestStage(player, DeathPlateau.questName, 19)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
|
||||||
|
on(Scenery.LARGE_DOOR_3743, SCENERY, "open") { player, node ->
|
||||||
|
if (questStage(player, DeathPlateau.questName) > 16) {
|
||||||
|
DoorActionHandler.handleAutowalkDoor(player, node as core.game.node.scenery.Scenery)
|
||||||
|
} else {
|
||||||
|
sendMessage(player, "The door is locked.")
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,204 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
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.NPCs
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Denulth sub dialogue file for death plateau.
|
||||||
|
* Called by EohricDialogue
|
||||||
|
* @author bushtail
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
|
||||||
|
class DenulthDialogueFile : DialogueFile() {
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
in 0..4 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hello citizen, how can I help you?").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic("Do you have any quests for me?", 100),
|
||||||
|
Topic("What is this place?", 200),
|
||||||
|
Topic(FacialExpression.ANNOYED, "You can't, thanks.", END_DIALOGUE)
|
||||||
|
)
|
||||||
|
100 -> npcl(FacialExpression.FRIENDLY, "I don't know if you can help us!").also { stage++ }
|
||||||
|
101 -> npcl(FacialExpression.FRIENDLY, "The trolls have taken up camp on the Death Plateau! They are using it to launch raids at night on the village. We have tried to attack the camp, but the main path is heavily guarded!").also { stage++ }
|
||||||
|
102 -> playerl(FacialExpression.ASKING, "Perhaps there is a way you can sneak up at night?").also { stage++ }
|
||||||
|
103 -> npcl(FacialExpression.FRIENDLY, "If there is another way, I do not know of it.").also { stage++ }
|
||||||
|
104 -> npcl(FacialExpression.FRIENDLY, "Do you know of such a path?").also { stage++ }
|
||||||
|
105 -> showTopics(
|
||||||
|
Topic(FacialExpression.THINKING,"No, but perhaps I could try and find one?", 300),
|
||||||
|
Topic(FacialExpression.ANNOYED, "No, sorry.", END_DIALOGUE)
|
||||||
|
)
|
||||||
|
|
||||||
|
200 -> npcl(FacialExpression.HAPPY, "Welcome to the Principality of Burthorpe! We are the Imperial Guard for his Royal Highness Prince Anlaf of Burthorpe. Can I assist you with anything else?").also { stage = 2 }
|
||||||
|
|
||||||
|
300 -> npc(FacialExpression.FRIENDLY, "Citizen you would be well rewarded!").also { stage++ }
|
||||||
|
301 -> npcl(FacialExpression.FRIENDLY, "If you go up to Death Plateau, be very careful as the trolls will attack you on sight!").also { stage++ }
|
||||||
|
302 -> playerl(FacialExpression.FRIENDLY, "I'll be careful.").also { stage++ }
|
||||||
|
303 -> npcl(FacialExpression.FRIENDLY, "One other thing.").also { stage++ }
|
||||||
|
304 -> playerl(FacialExpression.FRIENDLY, "What's that?").also { stage++ }
|
||||||
|
305 -> npcl(FacialExpression.FRIENDLY, "All of our equipment is kept in the castle on the hill.").also { stage++ }
|
||||||
|
306 -> npcl(FacialExpression.FRIENDLY, "The stupid guard that was on duty last night lost the combination to the lock! I told the Prince that the Imperial Guard should've been in charge of security!").also { stage++ }
|
||||||
|
307 -> playerl(FacialExpression.ASKING, "No problem, what does the combination look like?").also { stage++ }
|
||||||
|
308 -> npcl(FacialExpression.FRIENDLY, "The equipment room is unlocked when the stone balls are placed in the correct order on the stone mechanism outside it. The right order is written on a piece of paper the guard had.").also { stage++ }
|
||||||
|
309 -> playerl(FacialExpression.FRIENDLY, "A stone what...?!").also { stage++ }
|
||||||
|
310 -> npcl(FacialExpression.FRIENDLY, "Well citizen, the Prince is fond of puzzles. Why we couldn't just have a key is beyond me!").also { stage++ }
|
||||||
|
311 -> playerl(FacialExpression.SUSPICIOUS, "I'll get on it right away!").also {
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 5)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 5..21 -> {
|
||||||
|
when(stage) {
|
||||||
|
0 -> npcl(FacialExpression.HAPPY, "Hello citizen, is there anything you'd like to know?").also { stage++ }
|
||||||
|
1 -> showTopics(
|
||||||
|
Topic("Can you remind me of the quest I am on?", 100),
|
||||||
|
Topic("I thought the White Knights controlled Asgarnia?", 200),
|
||||||
|
Topic("What is this place?", 300),
|
||||||
|
Topic(FacialExpression.HAPPY, "That's all, thanks.", 10)
|
||||||
|
)
|
||||||
|
10 -> npcl(FacialExpression.HAPPY, "God speed citizen.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
100 -> npcl(FacialExpression.HALF_THINKING, "You offered to see if you could find another way up Death Plateau. We could then use it to sneak up and attack the trolls by night.").also { stage++ }
|
||||||
|
101 -> playerl(FacialExpression.THINKING, "Ah yes, and the guard had lost the combination to your equipment rooms in the castle on the hill?").also { stage++ }
|
||||||
|
102 -> npcl(FacialExpression.HAPPY, "That's right citizen, you offered to recover the combination and unlock the door.").also { stage++ }
|
||||||
|
103 -> playerl(FacialExpression.FRIENDLY, "I'll get on it right away!").also { stage++ }
|
||||||
|
104 -> npcl(FacialExpression.FRIENDLY, "Good work citizen!").also { stage++ }
|
||||||
|
105 -> npcl(FacialExpression.ASKING, "Is there anything else you would like to know?").also { stage = 1 }
|
||||||
|
|
||||||
|
200 -> npcl(FacialExpression.ANGRY, "You are right citizen. The White Knights have taken advantage of the old and weak king, they control most of Asgarnia, including Falador. However they do not control Burthorpe!").also { stage++ }
|
||||||
|
201 -> npcl(FacialExpression.EVIL_LAUGH, "We are the prince's elite troops! We keep Burthorpe secure!").also { stage++ }
|
||||||
|
202 -> npcl(FacialExpression.ANGRY, "The White Knights have overlooked us until now! They are pouring money into their war against the Black Knights, They are looking for an excuse to stop our funding and I'm afraid they may have found it!").also { stage++ }
|
||||||
|
203 -> npcl(FacialExpression.HALF_WORRIED, "If we can not destroy the troll camp on Death Plateau then the Imperial Guard will be disbanded and Burthorpe will come under control of the White Knights. We cannot let this happen!").also { stage++ }
|
||||||
|
204 -> npcl(FacialExpression.ASKING, "Is there anything else you'd like to know?").also { stage = 1 }
|
||||||
|
|
||||||
|
300 -> npcl(FacialExpression.HAPPY, "Welcome to the Principality of Burthorpe! We are the Imperial Guard for his Royal Highness Prince Anlaf of Burthorpe. Can I assist you with anything else?").also { stage = 1 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
22 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hello citizen, have you found another way up Death Plateau?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "Yes there is another way up Death Plateau!").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "We are saved!").also { stage++ }
|
||||||
|
4 -> playerl(FacialExpression.FRIENDLY, "There's one thing...").also { stage++ }
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "And what is that citizen?").also { stage++ }
|
||||||
|
6 -> playerl(FacialExpression.FRIENDLY, "There is a Sherpa who will only show me the secret way if I first get some spikes for his climbing boots. The smith will only do this for me if you sign up his son for the Imperial Guard!").also { stage++ }
|
||||||
|
7 -> npcl(FacialExpression.FRIENDLY, "Hmm...this is very irregular.").also { stage++ }
|
||||||
|
8 -> playerl(FacialExpression.FRIENDLY, "Will you not do this?").also { stage++ }
|
||||||
|
9 -> npcl(FacialExpression.FRIENDLY, "I have heard of Dunstan's son, he is a very promising young man. For the sake of your mission we can make an exception!").also { stage++ }
|
||||||
|
10 -> sendItemDialogue(player!!, Items.CERTIFICATE_3114, "Denulth has given you a certificate.").also {
|
||||||
|
addItemOrDrop(player!!, Items.CERTIFICATE_3114)
|
||||||
|
stage++
|
||||||
|
}
|
||||||
|
11 -> npcl(FacialExpression.FRIENDLY, "This certificate proves that we have accepted Dunstan's son for training in the Imperial Guard!").also { stage++ }
|
||||||
|
12 -> playerl(FacialExpression.FRIENDLY, "Thank you Denulth, I shall be back shortly!").also {
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 23)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
23 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hello citizen, have you found the secret way up Death Plateau?").also {
|
||||||
|
if (!inInventory(player!!, Items.CERTIFICATE_3114)) {
|
||||||
|
stage = 3
|
||||||
|
} else {
|
||||||
|
stage++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "I'm working on it, I just need to give the certificate to Dunstan.").also { stage = END_DIALOGUE }
|
||||||
|
3 -> playerl(FacialExpression.FRIENDLY, "I'm working on it but I've lost the certificate!").also { stage++ }
|
||||||
|
4 -> npcl(FacialExpression.FRIENDLY, "No problem, I have a duplicate.").also { stage++ }
|
||||||
|
5 -> sendItemDialogue(player!!, Items.CERTIFICATE_3114, "Denulth has given you a certificate.").also {
|
||||||
|
addItemOrDrop(player!!, Items.CERTIFICATE_3114)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 24 .. 26 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hello citizen, have you found the secret way up Death Plateau?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "Yes! There is a path that runs from a Sherpa's hut around the back of Death Plateau. The trolls haven't found it yet. The Sherpa made a map I can give you.").also {
|
||||||
|
if (!inInventory(player!!, Items.SECRET_WAY_MAP_3104)) {
|
||||||
|
stage = 3
|
||||||
|
} else {
|
||||||
|
stage = 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
3 -> playerl(FacialExpression.FRIENDLY, "I don't have the map on me..").also { stage = END_DIALOGUE }
|
||||||
|
4 -> sendItemDialogue(player!!, Items.SECRET_WAY_MAP_3104, "You give Denulth the map of the secret way.").also {
|
||||||
|
if (removeItem(player!!, Item(Items.SECRET_WAY_MAP_3104))) {
|
||||||
|
stage++
|
||||||
|
} else {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "Excellent, this looks perfect. They will never see us coming.").also { stage++ }
|
||||||
|
6 -> npcl(FacialExpression.FRIENDLY, "Have you managed to open the equipment room?").also {
|
||||||
|
if (!inInventory(player!!, Items.COMBINATION_3102)) {
|
||||||
|
stage = 7
|
||||||
|
} else {
|
||||||
|
stage = 8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
7 -> playerl(FacialExpression.FRIENDLY, "I have opened the door but I don't have the combination on me.").also { stage++ }
|
||||||
|
8 -> playerl(FacialExpression.FRIENDLY, "Yes! The door is open and here is the combination.").also { stage++ }
|
||||||
|
9 -> sendItemDialogue(player!!, Items.COMBINATION_3102, "You give Denulth the combination to the equipment room.").also {
|
||||||
|
if (removeItem(player!!, Item(Items.COMBINATION_3102))) {
|
||||||
|
stage++
|
||||||
|
} else {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY, "Well done citizen! We will reward you by training you in attack!").also { stage++ }
|
||||||
|
11 -> npcl(FacialExpression.FRIENDLY, "I shall present you with some steel fighting claws. In addition I shall show you the knowledge of creating the fighting claws for yourself.").also { stage++ }
|
||||||
|
12 -> npcl(FacialExpression.FRIENDLY, "You are now an honourary member of the Imperial Guard!").also { stage++ }
|
||||||
|
13 -> {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
finishQuest(player!!, DeathPlateau.questName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
100 -> {
|
||||||
|
// This should go to Troll Stronghold.
|
||||||
|
when(stage) {
|
||||||
|
0 -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.HAPPY, "Welcome back friend!").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic("How goes your fight with the trolls?", 10),
|
||||||
|
Topic("I thought the White Knights controlled Asgarnia?", 20),
|
||||||
|
Topic(FacialExpression.HAPPY, "See you about Denulth!", 30)
|
||||||
|
)
|
||||||
|
|
||||||
|
10 -> npcl(FacialExpression.HALF_WORRIED, "I'm afraid I have bad news. We made our attack as planned, but we met unexpected resistance.").also { stage++ }
|
||||||
|
11 -> playerl(FacialExpression.HALF_ASKING, "What happened?").also { stage++ }
|
||||||
|
12 -> npcl(FacialExpression.WORRIED, "We were ambushed by trolls coming from the north. They captured Dunstan's son, Godric, who we enlisted at your request, we tried to follow but we were repelled at the foot of their stronghold.").also { stage++ }
|
||||||
|
13 -> showTopics(
|
||||||
|
Topic(FacialExpression.SAD, "I'm sorry to hear that.", END_DIALOGUE),
|
||||||
|
Topic("Is there anything I can do to help?", 100)
|
||||||
|
)
|
||||||
|
100 -> npcl(FacialExpression.LAUGH, "Not until we implement Troll Stronghold you can't!").also { stage = END_DIALOGUE }
|
||||||
|
/**
|
||||||
|
100 -> npcl(FacialExpression.HALF_WORRIED, "The way to the stronghold is treacherous, friend. Even if you manage to climb your way up, there will be many trolls defending the stronghold.").also{ stage++ }
|
||||||
|
101 -> playerl(FacialExpression.FRIENDLY, "I'll get Godric back!").also { stage++ }
|
||||||
|
102 -> npcl(FacialExpression.HAPPY, "God speed friend! I would send some of my men with you, but none of them are brave enough to follow.").also { stage = END_DIALOGUE; strongholdquest.start(player)
|
||||||
|
**/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,156 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.interaction.InterfaceListener
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.system.task.Pulse
|
||||||
|
import org.rs09.consts.Components
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author bushtail
|
||||||
|
* Thanks for your work on this quest Phil, it's appreciated.
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
|
||||||
|
class DiceGameInterfaceListener : InterfaceListener {
|
||||||
|
companion object {
|
||||||
|
val GOLDSTACKS = intArrayOf(995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004)
|
||||||
|
val GOLDTHRESHOLDS = intArrayOf(1, 2, 3, 4, 5, 25, 100, 250, 1000, 10000)
|
||||||
|
|
||||||
|
const val ATTRIBUTE_HAROLD_DICE_1 = "deathplateau:harold1"
|
||||||
|
const val ATTRIBUTE_HAROLD_DICE_2 = "deathplateau:harold2"
|
||||||
|
const val ATTRIBUTE_PLAYER_DICE_1 = "deathplateau:player1"
|
||||||
|
const val ATTRIBUTE_PLAYER_DICE_2 = "deathplateau:player2"
|
||||||
|
const val ATTRIBUTE_WIN_STATE = "deathplateau:winstate"
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun defineInterfaceListeners() {
|
||||||
|
onOpen(Components.DEATH_DICE_99) { player, _ ->
|
||||||
|
var goldID = 0
|
||||||
|
var wager = player.getAttribute<Int>("deathplateau:wager", 50)
|
||||||
|
player.setAttribute(ATTRIBUTE_HAROLD_DICE_1, 0)
|
||||||
|
player.setAttribute(ATTRIBUTE_HAROLD_DICE_2, 0)
|
||||||
|
player.setAttribute(ATTRIBUTE_PLAYER_DICE_1, 0)
|
||||||
|
player.setAttribute(ATTRIBUTE_PLAYER_DICE_2, 0)
|
||||||
|
player.setAttribute(ATTRIBUTE_WIN_STATE, false)
|
||||||
|
goldID = when(wager){
|
||||||
|
1 -> GOLDSTACKS[0]
|
||||||
|
2 -> GOLDSTACKS[1]
|
||||||
|
3 -> GOLDSTACKS[2]
|
||||||
|
4 -> GOLDSTACKS[3]
|
||||||
|
5 -> GOLDSTACKS[4]
|
||||||
|
in 25..99 -> GOLDSTACKS[5]
|
||||||
|
in 100..249 -> GOLDSTACKS[6]
|
||||||
|
in 250..999 -> GOLDSTACKS[7]
|
||||||
|
in 1000..9999 -> GOLDSTACKS[8]
|
||||||
|
else -> GOLDSTACKS[9]
|
||||||
|
}
|
||||||
|
sendItemOnInterface(player, Components.DEATH_DICE_99, 7, goldID, wager)
|
||||||
|
sendItemOnInterface(player, Components.DEATH_DICE_99, 8, goldID, wager)
|
||||||
|
setComponentVisibility(player, Components.DEATH_DICE_99, 9, true)
|
||||||
|
setInterfaceText(player, "Harold rolls...", Components.DEATH_DICE_99, 13)
|
||||||
|
preRoll(player)
|
||||||
|
setInterfaceText(player, player.username, Components.DEATH_DICE_99,6)
|
||||||
|
(1..4).forEach { sendAnimationOnInterface(player, 1149, Components.DEATH_DICE_99, it) }
|
||||||
|
submitRollPulse(player, true)
|
||||||
|
return@onOpen true
|
||||||
|
}
|
||||||
|
|
||||||
|
on(Components.DEATH_DICE_99){ player, _, _, buttonID, _, _ ->
|
||||||
|
when(buttonID) {
|
||||||
|
10 -> submitRollPulse(player, false)
|
||||||
|
12 -> {
|
||||||
|
closeInterface(player)
|
||||||
|
val callback: (() -> Unit)? =
|
||||||
|
getAttribute(player, "deathplateau:dicegameclose", null)
|
||||||
|
callback?.invoke()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
onClose(Components.DEATH_DICE_99){ player, _ ->
|
||||||
|
setComponentVisibility(player, Components.DEATH_DICE_99, 9, true)
|
||||||
|
setComponentVisibility(player, Components.DEATH_DICE_99, 11, true)
|
||||||
|
return@onClose true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun onClose(deathDice99: Int, any: Any) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun preRoll(player: Player, triesRemaining: Int = 5) {
|
||||||
|
val h1 = (1..5).random()
|
||||||
|
val h2 = (1..5).random()
|
||||||
|
val p1 = (1..5).random()
|
||||||
|
val p2 = (1..5).random()
|
||||||
|
if(h1 + h2 == p1 + p2 && triesRemaining > 0) {
|
||||||
|
preRoll(player, triesRemaining - 1)
|
||||||
|
} else {
|
||||||
|
player.setAttribute(ATTRIBUTE_HAROLD_DICE_1, h1)
|
||||||
|
player.setAttribute(ATTRIBUTE_HAROLD_DICE_2, h2)
|
||||||
|
player.setAttribute(ATTRIBUTE_PLAYER_DICE_1, p1)
|
||||||
|
player.setAttribute(ATTRIBUTE_PLAYER_DICE_2, p2)
|
||||||
|
player.setAttribute(ATTRIBUTE_WIN_STATE, h1 + h2 < p1 + p2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun submitRollPulse(player: Player, isNPCTurn: Boolean) {
|
||||||
|
val roll1: Int
|
||||||
|
val roll2: Int
|
||||||
|
|
||||||
|
if (isNPCTurn) {
|
||||||
|
roll1 = getAttribute<Int?>(player, ATTRIBUTE_HAROLD_DICE_1, null) ?: return
|
||||||
|
roll2 = getAttribute<Int?>(player, ATTRIBUTE_HAROLD_DICE_2, null) ?: return
|
||||||
|
} else {
|
||||||
|
roll1 = getAttribute<Int?>(player, ATTRIBUTE_PLAYER_DICE_1, null) ?: return
|
||||||
|
roll2 = getAttribute<Int?>(player, ATTRIBUTE_PLAYER_DICE_2, null) ?: return
|
||||||
|
}
|
||||||
|
|
||||||
|
val component1 = if (isNPCTurn) 2 else 3
|
||||||
|
val component2 = if (isNPCTurn) 1 else 4
|
||||||
|
|
||||||
|
submitWorldPulse(
|
||||||
|
InterfaceUpdatePulse(
|
||||||
|
player, isNPCTurn,
|
||||||
|
component1, component2,
|
||||||
|
roll1, roll2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private class InterfaceUpdatePulse(val player: Player, val isNPCTurn: Boolean, val component1: Int, val component2: Int, val roll1: Int, val roll2: Int) : Pulse() {
|
||||||
|
val DICEANIM = intArrayOf(42069, 1150, 1151, 1152, 1153, 1154, 1155)
|
||||||
|
var counter = 0
|
||||||
|
override fun pulse(): Boolean {
|
||||||
|
when (counter++) {
|
||||||
|
1 -> {
|
||||||
|
setComponentVisibility(player, Components.DEATH_DICE_99, 9, true)
|
||||||
|
if (isNPCTurn) {
|
||||||
|
setInterfaceText(player, "Harold rolls...", Components.DEATH_DICE_99, 13)
|
||||||
|
} else {
|
||||||
|
setInterfaceText(player, "Your roll...", Components.DEATH_DICE_99, 13)
|
||||||
|
}
|
||||||
|
sendAnimationOnInterface(player, DICEANIM[roll1], Components.DEATH_DICE_99, component1)
|
||||||
|
}
|
||||||
|
4 -> sendAnimationOnInterface(player, DICEANIM[roll2], Components.DEATH_DICE_99, component2)
|
||||||
|
7 -> {
|
||||||
|
if (isNPCTurn) {
|
||||||
|
setComponentVisibility(player, Components.DEATH_DICE_99, 9, false)
|
||||||
|
} else {
|
||||||
|
if (player.getAttribute<Boolean>("deathplateau:winstate")) {
|
||||||
|
setInterfaceText(player,"You win!", Components.DEATH_DICE_99, 13)
|
||||||
|
} else {
|
||||||
|
setInterfaceText(player,"You lose!", Components.DEATH_DICE_99, 13)
|
||||||
|
}
|
||||||
|
setComponentVisibility(player, Components.DEATH_DICE_99, 11, false)
|
||||||
|
setComponentVisibility(player, Components.DEATH_DICE_99, 9, true)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
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 core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
class DunstanDialogueFile : DialogueFile() {
|
||||||
|
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
21 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hi! How can I help?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "Tenzing has asked me to bring you his climbing boots, he needs to have spikes put on them.").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "He does, does he? Well I won't do it till he pays for the last set I made for him!").also { stage++ }
|
||||||
|
4 -> playerl(FacialExpression.FRIENDLY, "This is really important!").also { stage++ }
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "How so?").also { stage++ }
|
||||||
|
6 -> playerl(FacialExpression.FRIENDLY, "Well, I need the Sherpa to show me a secret way up Death Plateau so that the Imperial Guard can destroy the troll camp! He won't help me till I've got the spikes!").also { stage++ }
|
||||||
|
7 -> npcl(FacialExpression.FRIENDLY, "Hmm. That's different!").also { stage++ }
|
||||||
|
8 -> npcl(FacialExpression.FRIENDLY, "Tell you what, I'll make them for you on one condition.").also { stage++ }
|
||||||
|
9 -> playerl(FacialExpression.FRIENDLY, "*sigh* What's the condition?").also { stage++ }
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY, "My son has just turned 16 and I'd very much like him to join the Imperial Guard. The Prince's elite forces are invite only so it's very unlikely he'll get in. If you can arrange that you have a deal!").also { stage++ }
|
||||||
|
11 -> playerl(FacialExpression.FRIENDLY, "That won't be a problem as I'm helping out the Imperial Guard!").also { stage++ }
|
||||||
|
12 -> npcl(FacialExpression.FRIENDLY, "Excellent! You'll need to bring an Iron bar for the spikes!").also {
|
||||||
|
setQuestStage(player!!, "Death Plateau", 22)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
22 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Have you managed to get my son signed up for the Imperial Guard?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "Not yet! I just need to speak to Denulth!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
23 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Have you managed to get my son signed up for the Imperial Guard?").also {
|
||||||
|
stage++
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> {
|
||||||
|
if (!inInventory(player!!, Items.CERTIFICATE_3114)) {
|
||||||
|
playerl(FacialExpression.FRIENDLY, "I have but I don't have the entrance certificate on me.").also { stage++ }
|
||||||
|
} else {
|
||||||
|
sendDialogue(player!!, "You give Dunstan the certificate.").also { stage = 5 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "Good but I need to have the certificate.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "Thank you!").also {
|
||||||
|
// Jumps to the next stage immediately in one continuous dialogue (questStage 24, stage 2).
|
||||||
|
setQuestStage(player!!, "Death Plateau", 24)
|
||||||
|
stage = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
24 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
2 -> npcl(FacialExpression.FRIENDLY, "Now to keep my end of the bargain. Give me the boots and an iron bar and I'll put on the spikes.").also {
|
||||||
|
if (inInventory(player!!, Items.CLIMBING_BOOTS_3105) && inInventory(player!!, Items.IRON_BAR_2351)) {
|
||||||
|
stage = 7
|
||||||
|
} else if (inInventory(player!!, Items.CLIMBING_BOOTS_3105)){
|
||||||
|
stage = 3
|
||||||
|
} else if (inInventory(player!!, Items.IRON_BAR_2351)){
|
||||||
|
stage = 4
|
||||||
|
} else {
|
||||||
|
stage = 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
3 -> playerl(FacialExpression.FRIENDLY, "I don't have the iron bar.").also { stage = END_DIALOGUE }
|
||||||
|
4 -> playerl(FacialExpression.FRIENDLY, "I don't have the climbing boots.").also { stage = END_DIALOGUE }
|
||||||
|
5 -> playerl(FacialExpression.FRIENDLY, "I don't have the iron bar or the climbing boots.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
7 -> sendDoubleItemDialogue(player!!, Items.IRON_BAR_2351, Items.CLIMBING_BOOTS_3105, "You give Dunstan an iron bar and the climbing boots.").also {
|
||||||
|
if (removeItem(player!!, Item(Items.CLIMBING_BOOTS_3105)) && removeItem(player!!, Item(Items.IRON_BAR_2351))) {
|
||||||
|
stage++
|
||||||
|
} else {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
8 -> sendItemDialogue(player!!, Items.SPIKED_BOOTS_3107, "Dunstan has given you the spiked boots.").also { stage++
|
||||||
|
addItemOrDrop(player!!, Items.SPIKED_BOOTS_3107)
|
||||||
|
}
|
||||||
|
9 -> playerl(FacialExpression.FRIENDLY, "Thank you!").also { stage++ }
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY, "No problem.").also {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.getAttribute
|
||||||
|
import core.api.questStage
|
||||||
|
import core.api.setAttribute
|
||||||
|
import core.api.setQuestStage
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Eohric sub dialogue file for death plateau.
|
||||||
|
* Called by EohricDialogue
|
||||||
|
* @author bushtail
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
class EohricDialogueFile : DialogueFile() {
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
in 5..9 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.FRIENDLY, "Hi, can I help?").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic(FacialExpression.THINKING, "I'm looking for the guard that was on the last night.", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Do you know of another way up Death Plateau?", 20),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "No, I'm just looking around.", END_DIALOGUE)
|
||||||
|
)
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY,"There was only one guard on last night. Harold. He's a nice lad, if a little dim.").also { stage++ }
|
||||||
|
11 -> player(FacialExpression.FRIENDLY, "Do you know where he is staying?").also { stage++ }
|
||||||
|
12 -> npc(FacialExpression.FRIENDLY, "Harold is staying at the Toad and Chicken.").also { stage++ }
|
||||||
|
13 -> player(FacialExpression.FRIENDLY, "Thanks!").also {
|
||||||
|
setQuestStage(player!!, "Death Plateau", 10)
|
||||||
|
HaroldDialogueFile.resetNpc(player!!)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "No, sorry. I wouldn't want to go north-east from here, it's very rocky and barren.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
10 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.FRIENDLY, "Hi, can I help?").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic(FacialExpression.THINKING, "Where is the guard that was on last night staying?", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Do you know of another way up Death Plateau?", 20),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "No, I'm just looking around.", END_DIALOGUE)
|
||||||
|
)
|
||||||
|
10 -> npc(FacialExpression.FRIENDLY, "Harold is staying at the Toad and Chicken.").also { stage = END_DIALOGUE }
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "No, sorry. I wouldn't want to go north-east from here, it's very rocky and barren.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
11 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.FRIENDLY, "Hi, can I help?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.HALF_GUILTY, "I found Harold but he won't talk to me!.").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.THINKING, "Hmm. Harold has got in trouble a few over his drinking and gambling. Perhaps he'd open up after a drink?").also { stage++ }
|
||||||
|
4 -> playerl(FacialExpression.FRIENDLY, "Thanks, I'll try that!").also {
|
||||||
|
setQuestStage(player!!, "Death Plateau", 12)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
12 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.FRIENDLY, "Hi, can I help?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.ASKING, "You said Harold had a weakness?").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.THINKING,"Yes, if you buy Harold a beer he might talk to you. I also know he has a weakness for gambling. Hope that helps!").also { stage++ }
|
||||||
|
4 -> playerl(FacialExpression.FRIENDLY, "Thanks for the help!").also {stage = END_DIALOGUE}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,404 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.item.Item
|
||||||
|
import core.game.world.update.flag.context.Graphics
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.Animations
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Harold sub dialogue file for death plateau.
|
||||||
|
* Called by HaroldDialogue
|
||||||
|
* @author bushtail
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
class HaroldDialogueFile : DialogueFile() {
|
||||||
|
|
||||||
|
companion object{
|
||||||
|
const val ATTRIBUTE_JUMPSTAGE = "deathplateau:jumpStage"
|
||||||
|
const val ATTRIBUTE_HAROLD_MONEY = "/save:deathplateau:haroldMoney"
|
||||||
|
|
||||||
|
/** Resets the NPC's quest attributes */
|
||||||
|
fun resetNpc(player: Player) {
|
||||||
|
setAttribute(player, ATTRIBUTE_JUMPSTAGE, 0)
|
||||||
|
setAttribute(player, ATTRIBUTE_HAROLD_MONEY, 200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
// This jumpStage is needed to resume the conversation after the dice interface.
|
||||||
|
// The dice interface closes the dialogue file.
|
||||||
|
if(getAttribute(player!!, ATTRIBUTE_JUMPSTAGE, 0) != 0) {
|
||||||
|
stage = getAttribute(player!!, ATTRIBUTE_JUMPSTAGE, 0);
|
||||||
|
setAttribute(player!!, ATTRIBUTE_JUMPSTAGE, 0)
|
||||||
|
}
|
||||||
|
println(getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, -1))
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
10 -> { // First time meeting.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hi.").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "You're the guard that was on duty last night?").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "Yeah.").also { stage++ }
|
||||||
|
4 -> playerl(FacialExpression.HAPPY, "Denulth said that you lost the combination to the equipment room ?").also { stage++ }
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "I don't want to talk about it!").also {
|
||||||
|
setQuestStage(player!!, "Death Plateau", 11)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
11 -> { // Asking again.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.ANNOYED, "What?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "You're the guard that was on duty last night?").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "I said I didn't want to talk about it!").also {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
12 -> { // After asking Eohric about opening up.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hi.").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "Can I buy you a drink?").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.HAPPY, "Now you're talking! An Asgarnian Ale, please!").also { stage++ }
|
||||||
|
4 -> {
|
||||||
|
if (inInventory(player!!, Items.ASGARNIAN_ALE_1905, 1)) {
|
||||||
|
removeItem(player!!, Items.ASGARNIAN_ALE_1905)
|
||||||
|
setQuestStage(player!!, "Death Plateau", 12)
|
||||||
|
sendMessage(player!!, "You give Harold an Asgarnian Ale.")
|
||||||
|
setAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, 200)
|
||||||
|
sendItemDialogue(player!!, Items.ASGARNIAN_ALE_1905, "You give Harold an Asgarnian Ale.").also { stage++ }
|
||||||
|
} else {
|
||||||
|
playerl(FacialExpression.FRIENDLY, "I'll go and get you one.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
5 -> {
|
||||||
|
end()
|
||||||
|
setQuestStage(player!!, "Death Plateau", 13)
|
||||||
|
animate(npc!!, Animations.HUMAN_EATTING_829)
|
||||||
|
runTask(npc!!, 5) {
|
||||||
|
npcl(FacialExpression.FRIENDLY, "Arrh. That hit the spot!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
13 -> { // After getting him an Asgarnian Ale.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.FRIENDLY, "Hi.").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic(FacialExpression.ASKING, "Where were you when you last had the combination?", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Would you like to gamble?", 30),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Can I buy you a drink?", 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY, "I honestly don't know! I've looked everywhere. I've searched the castle and my room!").also { stage++ }
|
||||||
|
11 -> playerl(FacialExpression.ASKING, "Have you tried looking between here and the castle?").also { stage++ }
|
||||||
|
12 -> npcl(FacialExpression.FRIENDLY, "Yeah, I tried that.").also { stage++ }
|
||||||
|
13 -> npcl(FacialExpression.FRIENDLY, "I need another beer.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "Sounds good! I normally drink Asgarnian Ale but you know what?").also { stage++ }
|
||||||
|
21 -> playerl(FacialExpression.ASKING, "What?").also { stage++ }
|
||||||
|
22 -> npcl(FacialExpression.FRIENDLY, "I really fancy one of those Blurberry Specials. I never get over to the Gnome Stronghold so I haven't had one for ages!").also { stage++ }
|
||||||
|
23 -> {
|
||||||
|
if (removeItem(player!!, Items.BLURBERRY_SPECIAL_2064)) {
|
||||||
|
sendMessage(player!!, "You give Harold a Blurberry Special.")
|
||||||
|
sendItemDialogue(player!!, Items.BLURBERRY_SPECIAL_2064, "You give Harold a Blurberry Special.").also { stage++ }
|
||||||
|
} else if (removeItem(player!!, Items.PREMADE_BLURB_SP_2028)) {
|
||||||
|
sendMessage(player!!, "You give Harold a Blurberry Special.")
|
||||||
|
sendItemDialogue(player!!, Items.PREMADE_BLURB_SP_2028, "You give Harold a Blurberry Special.").also { stage++ }
|
||||||
|
} else {
|
||||||
|
player(FacialExpression.FRIENDLY, "I'll go and get you one.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
24 -> {
|
||||||
|
end()
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 14)
|
||||||
|
npc!!.isWalks = false
|
||||||
|
animate(npc!!, Animations.HUMAN_EATTING_829)
|
||||||
|
runTask(npc!!, 4) {
|
||||||
|
npc!!.sendChat("Wow!")
|
||||||
|
runTask(npc!!, 4) {
|
||||||
|
sendGraphics(Graphics(80, 96), npc!!.location)
|
||||||
|
runTask(npc!!, 6) {
|
||||||
|
npc(FacialExpression.DRUNK, "Now THAT hit the spot!").also {
|
||||||
|
runTask(npc!!, 6) {
|
||||||
|
npc!!.isWalks = true
|
||||||
|
end()
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
30 -> npcl(FacialExpression.FRIENDLY, "Good. Good. I have some dice. How much do you want to offer?").also { stage++ }
|
||||||
|
31 -> {
|
||||||
|
sendInputDialogue(player!!, true, "Enter amount:") { value ->
|
||||||
|
val wagerAmount = value as Int
|
||||||
|
// Check wager amount.
|
||||||
|
if (wagerAmount <= 0) {
|
||||||
|
sendMessage(player!!, "You have to offer some money.").also { stage = END_DIALOGUE }
|
||||||
|
} else if (wagerAmount > 1000) {
|
||||||
|
npcl(FacialExpression.FRIENDLY, "Woah! Do you think I'm made of money? Max bet is 1000 gold.").also { stage = END_DIALOGUE }
|
||||||
|
} else if (!inInventory(player!!, Items.COINS_995) || amountInInventory(player!!, Items.COINS_995) < value) {
|
||||||
|
sendMessage(player!!, "You do not have that much money!").also { stage = END_DIALOGUE }
|
||||||
|
} else if (removeItem(player!!, Item(Items.COINS_995, value))) {
|
||||||
|
player!!.setAttribute("deathplateau:wager", wagerAmount)
|
||||||
|
npc(FacialExpression.FRIENDLY, "OK. I'll roll first!").also { stage++ }
|
||||||
|
}
|
||||||
|
return@sendInputDialogue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
32 -> {
|
||||||
|
npcl(FacialExpression.FRIENDLY, "Don't forget that once I start my roll you can't back out of the bet! If you do you lose your stake!").also { stage++ }
|
||||||
|
}
|
||||||
|
33 -> {
|
||||||
|
end()
|
||||||
|
npc!!.isWalks = false
|
||||||
|
// Dialogue drops when another interface is clicked. So a resume dialogue is needed.
|
||||||
|
val advanceStage : (() -> Unit) = {
|
||||||
|
npc!!.isWalks = true
|
||||||
|
setAttribute(player!!, ATTRIBUTE_JUMPSTAGE, stage + 1)
|
||||||
|
openDialogue(player!!, HaroldDialogueFile(), npc!!)
|
||||||
|
}
|
||||||
|
setAttribute(player!!, "deathplateau:dicegameclose", advanceStage)
|
||||||
|
openInterface(player!!, 99)
|
||||||
|
setInterfaceText(player!!, player!!.name, 99, 6)
|
||||||
|
}
|
||||||
|
34 -> {
|
||||||
|
val wager = getAttribute(player!!, "deathplateau:wager", 0)
|
||||||
|
val haroldAmount = getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, 0)
|
||||||
|
if (getAttribute(player!!, "deathplateau:winstate", false)) {
|
||||||
|
// Win
|
||||||
|
if (wager > haroldAmount) {
|
||||||
|
npcl(FacialExpression.FRIENDLY, "Oh dear, I seem to have run out of money!").also { stage++ }
|
||||||
|
} else {
|
||||||
|
addItemOrDrop(player!!, Items.COINS_995, wager * 2)
|
||||||
|
sendMessage(player!!, "Harold has given you your winnings!")
|
||||||
|
setAttribute(player!!, ATTRIBUTE_HAROLD_MONEY,haroldAmount - wager)
|
||||||
|
sendItemDialogue(player!!, Items.COINS_995, "Harold has given you your winnings!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Lose
|
||||||
|
setAttribute(player!!, ATTRIBUTE_HAROLD_MONEY,haroldAmount + wager)
|
||||||
|
sendItemDialogue(player!!, Items.COINS_995, "You give Harold his winnings.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
35 -> npcl(FacialExpression.FRIENDLY, "Here's what I have.").also { stage++ }
|
||||||
|
36 -> sendItemDialogue(player!!, Items.COINS_995, "Harold has given you some of your winnings!").also {
|
||||||
|
sendMessage(player!!, "Harold has given you some of your winnings!")
|
||||||
|
val haroldAmount = getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, 200)
|
||||||
|
setAttribute(player!!, ATTRIBUTE_HAROLD_MONEY,0)
|
||||||
|
addItemOrDrop(player!!, Items.COINS_995, haroldAmount);
|
||||||
|
stage++
|
||||||
|
}
|
||||||
|
37 -> npcl(FacialExpression.FRIENDLY, "I'll write you out an IOU for the rest.").also { stage++ }
|
||||||
|
38 -> {
|
||||||
|
addItemOrDrop(player!!, Items.IOU_3103)
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 15)
|
||||||
|
sendMessage(player!!, "Harold has given you an IOU scribbled on some paper.")
|
||||||
|
sendItemDialogue(player!!, Items.IOU_3103, "Harold has given you an IOU scribbled on some paper.").also {stage = END_DIALOGUE}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
14 -> { // After getting him a Blurberry Special.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> player(FacialExpression.FRIENDLY, "Hello there.").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.DRUNK, "'Ello matey!'").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic(FacialExpression.THINKING, "Where were you when you last had the combination?", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Would you like to gamble?", 20),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Can I buy you a drink?", 15)
|
||||||
|
)
|
||||||
|
|
||||||
|
10 -> npc(FacialExpression.DRUNK,"Hmm...!").also { stage++ }
|
||||||
|
11 -> npc(FacialExpression.DRUNK,"Er...!").also { stage++ }
|
||||||
|
12 -> npc(FacialExpression.DRUNK,"What wash the queshtion?").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
15 -> npcl(FacialExpression.DRUNK, "I fink I've had enough!").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
20 -> npc(FacialExpression.DRUNK,"Shure!").also { stage++ }
|
||||||
|
21 -> npc(FacialExpression.DRUNK,"Place your betsh pleashe!").also { stage++ }
|
||||||
|
22 -> npc(FacialExpression.DRUNK,"*giggle*!").also { stage++ }
|
||||||
|
|
||||||
|
23 -> {
|
||||||
|
sendInputDialogue(player!!, true, "Enter amount:") { value ->
|
||||||
|
val wagerAmount = value as Int
|
||||||
|
// Check wager amount.
|
||||||
|
if (wagerAmount <= 0) {
|
||||||
|
sendMessage(player!!, "You have to offer some money.").also { stage = END_DIALOGUE }
|
||||||
|
} else if (wagerAmount > 1000) {
|
||||||
|
npcl(FacialExpression.DRUNK, "Eashy tiger! Max bet ish 1000 coinsh.").also { stage = END_DIALOGUE }
|
||||||
|
} else if (!inInventory(player!!, Items.COINS_995) || amountInInventory(player!!, Items.COINS_995) < value) {
|
||||||
|
sendMessage(player!!, "You do not have that much money!").also { stage = END_DIALOGUE }
|
||||||
|
} else if (removeItem(player!!, Item(Items.COINS_995, value))) {
|
||||||
|
player!!.setAttribute("deathplateau:wager", wagerAmount)
|
||||||
|
npc(FacialExpression.DRUNK, "Right...er...here goes...").also { stage++ }
|
||||||
|
}
|
||||||
|
return@sendInputDialogue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
24 -> {
|
||||||
|
end()
|
||||||
|
npc!!.isWalks = false
|
||||||
|
// Dialogue drops when another interface is clicked. So a resume dialogue is needed.
|
||||||
|
val advanceStage : (() -> Unit) = {
|
||||||
|
setAttribute(player!!, ATTRIBUTE_JUMPSTAGE, stage + (1..4).random())
|
||||||
|
openDialogue(player!!, HaroldDialogueFile(), npc!!)
|
||||||
|
}
|
||||||
|
setAttribute(player!!, "deathplateau:dicegameclose", advanceStage)
|
||||||
|
openInterface(player!!, 99)
|
||||||
|
setInterfaceText(player!!, player!!.name, 99, 6)
|
||||||
|
}
|
||||||
|
25 -> npc(FacialExpression.DRUNK, "Shixteen! How am I shupposhed to beat that!").also { stage = 30 }
|
||||||
|
26 -> npc(FacialExpression.DRUNK, "I didn't know you could ushe four dishe. Oh well.").also { stage = 30 }
|
||||||
|
27 -> npc(FacialExpression.DRUNK, "*hic*").also { stage = 30 }
|
||||||
|
28 -> npc(FacialExpression.DRUNK, "I sheemed to have rolled a one.").also { stage = 30 }
|
||||||
|
30 -> {
|
||||||
|
sendDialogue(player!!, "Harold is so drunk he can hardly see, let alone count!").also { stage++ }
|
||||||
|
npc!!.isWalks = true
|
||||||
|
sendMessage(player!!, "Harold is so drunk he can hardly see, let alone count!")
|
||||||
|
}
|
||||||
|
31 -> {
|
||||||
|
val wager = getAttribute(player!!, "deathplateau:wager", 0)
|
||||||
|
val haroldAmount = getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, 0)
|
||||||
|
// Always Win
|
||||||
|
if (wager > haroldAmount) {
|
||||||
|
npcl(FacialExpression.DRUNK, " Um...not enough money.").also { stage++ }
|
||||||
|
} else {
|
||||||
|
addItemOrDrop(player!!, Items.COINS_995, wager * 2)
|
||||||
|
sendMessage(player!!, "Harold has given you your winnings!")
|
||||||
|
setAttribute(player!!, ATTRIBUTE_HAROLD_MONEY,haroldAmount - wager)
|
||||||
|
sendItemDialogue(player!!, Items.COINS_995, "Harold has given you your winnings!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
32 -> npcl(FacialExpression.DRUNK, "Heresh shome of it.").also { stage++ }
|
||||||
|
33 -> sendItemDialogue(player!!, Items.COINS_995, "Harold has given you some of your winnings!").also {
|
||||||
|
sendMessage(player!!, "Harold has given you some of your winnings!")
|
||||||
|
val haroldAmount = getAttribute(player!!, ATTRIBUTE_HAROLD_MONEY, 200)
|
||||||
|
setAttribute(player!!, ATTRIBUTE_HAROLD_MONEY,0)
|
||||||
|
addItemOrDrop(player!!, Items.COINS_995, haroldAmount);
|
||||||
|
stage++
|
||||||
|
}
|
||||||
|
34 -> npcl(FacialExpression.DRUNK, "I owe you the resht!").also { stage++ }
|
||||||
|
35 -> {
|
||||||
|
addItemOrDrop(player!!, Items.IOU_3103)
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 15)
|
||||||
|
sendMessage(player!!, "Harold has given you an IOU scribbled on some paper.")
|
||||||
|
sendItemDialogue(player!!, Items.IOU_3103, "Harold has given you an IOU scribbled on some paper.").also {stage = END_DIALOGUE}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
15 -> { // If you lose your IOU
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> npcl(FacialExpression.FRIENDLY, "Hi.").also {
|
||||||
|
if (inInventory(player!!, Items.IOU_3103)){
|
||||||
|
stage = 5
|
||||||
|
} else {
|
||||||
|
stage++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
1 -> playerl(FacialExpression.FRIENDLY, "I've lost the IOU you gave me.").also { stage++ }
|
||||||
|
2 -> npcl(FacialExpression.FRIENDLY, "I'll write you another.").also { stage++ }
|
||||||
|
3 -> {
|
||||||
|
addItemOrDrop(player!!, Items.IOU_3103)
|
||||||
|
sendItemDialogue(player!!, Items.IOU_3103, "Harold has given you an IOU scribbled on some paper.").also {stage = END_DIALOGUE}
|
||||||
|
}
|
||||||
|
|
||||||
|
5 -> npc(FacialExpression.FRIENDLY, "Hi.").also { stage++ }
|
||||||
|
6 -> showTopics(
|
||||||
|
Topic(FacialExpression.ASKING, "Where were you when you last had the combination?", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Would you like to gamble?", 30),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Can I buy you a drink?", 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY, "I honestly don't know! I've looked everywhere. I've searched the castle and my room!").also { stage++ }
|
||||||
|
11 -> playerl(FacialExpression.ASKING, "Have you tried looking between here and the castle?").also { stage++ }
|
||||||
|
12 -> npcl(FacialExpression.FRIENDLY, "Yeah, I tried that.").also { stage++ }
|
||||||
|
13 -> npcl(FacialExpression.FRIENDLY, "I need another beer.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "I've run out of money!").also { stage++ }
|
||||||
|
21 -> npcl(FacialExpression.FRIENDLY, "Oh dear. I need beer.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
30 -> npcl(FacialExpression.HAPPY, "Now you're talking! An Asgarnian Ale, please!").also { stage++ }
|
||||||
|
31 -> {
|
||||||
|
if (inInventory(player!!, Items.ASGARNIAN_ALE_1905, 1)) {
|
||||||
|
removeItem(player!!, Items.ASGARNIAN_ALE_1905)
|
||||||
|
sendMessage(player!!, "You give Harold an Asgarnian Ale.")
|
||||||
|
sendItemDialogue(player!!, Items.ASGARNIAN_ALE_1905, "You give Harold an Asgarnian Ale.").also { stage++ }
|
||||||
|
} else {
|
||||||
|
playerl(FacialExpression.FRIENDLY, "I'll go and get you one.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
32 -> {
|
||||||
|
end()
|
||||||
|
animate(npc!!, Animations.HUMAN_EATTING_829)
|
||||||
|
runTask(npc!!, 5) {
|
||||||
|
npcl(FacialExpression.FRIENDLY, "Arrh. That hit the spot!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 16 .. 29 -> { // If you lose your IOU
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> npcl(FacialExpression.FRIENDLY, "Hi.").also {
|
||||||
|
if (inInventory(player!!, Items.COMBINATION_3102) || inInventory(player!!, Items.IOU_3103)){
|
||||||
|
stage = 5
|
||||||
|
} else {
|
||||||
|
stage++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
1 -> playerl(FacialExpression.FRIENDLY, "I've lost the IOU you gave me.").also { stage++ }
|
||||||
|
2 -> npcl(FacialExpression.FRIENDLY, "I'll write you another.").also { stage++ }
|
||||||
|
3 -> {
|
||||||
|
addItemOrDrop(player!!, Items.COMBINATION_3102)
|
||||||
|
sendItemDialogue(player!!, Items.COMBINATION_3102, "Harold has given you the IOU, which you know is the combination.").also {stage = END_DIALOGUE}
|
||||||
|
}
|
||||||
|
|
||||||
|
5 -> npc(FacialExpression.FRIENDLY, "Hi.").also { stage++ }
|
||||||
|
6 -> showTopics(
|
||||||
|
Topic(FacialExpression.ASKING, "Where were you when you last had the combination?", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Would you like to gamble?", 30),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Can I buy you a drink?", 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
10 -> npcl(FacialExpression.FRIENDLY, "I honestly don't know! I've looked everywhere. I've searched the castle and my room!").also { stage++ }
|
||||||
|
11 -> playerl(FacialExpression.ASKING, "Have you tried looking between here and the castle?").also { stage++ }
|
||||||
|
12 -> npcl(FacialExpression.FRIENDLY, "Yeah, I tried that.").also { stage++ }
|
||||||
|
13 -> npcl(FacialExpression.FRIENDLY, "I need another beer.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "I've run out of money!").also { stage++ }
|
||||||
|
21 -> npcl(FacialExpression.FRIENDLY, "Oh dear. I need beer.").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
30 -> npcl(FacialExpression.HAPPY, "Now you're talking! An Asgarnian Ale, please!").also { stage++ }
|
||||||
|
31 -> {
|
||||||
|
if (inInventory(player!!, Items.ASGARNIAN_ALE_1905, 1)) {
|
||||||
|
removeItem(player!!, Items.ASGARNIAN_ALE_1905)
|
||||||
|
sendMessage(player!!, "You give Harold an Asgarnian Ale.")
|
||||||
|
sendItemDialogue(player!!, Items.ASGARNIAN_ALE_1905, "You give Harold an Asgarnian Ale.").also { stage++ }
|
||||||
|
} else {
|
||||||
|
playerl(FacialExpression.FRIENDLY, "I'll go and get you one.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
32 -> {
|
||||||
|
end()
|
||||||
|
animate(npc!!, Animations.HUMAN_EATTING_829)
|
||||||
|
runTask(npc!!, 5) {
|
||||||
|
npcl(FacialExpression.FRIENDLY, "Arrh. That hit the spot!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class IOUNoteDialogueFile : DialogueFile() {
|
||||||
|
var a = 0
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
in 15..16 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> player(FacialExpression.NEUTRAL, "The IOU says that Harold owes me some money.").also { stage++ }
|
||||||
|
1 -> player(FacialExpression.EXTREMELY_SHOCKED, "Wait just a minute!").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.EXTREMELY_SHOCKED, "The IOU is written on the back of the combination! The stupid guard had it in his back pocket all the time!").also { stage++ }
|
||||||
|
3 -> {
|
||||||
|
if (removeItem(player!!, Items.IOU_3103)) {
|
||||||
|
addItemOrDrop(player!!, Items.COMBINATION_3102)
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 16)
|
||||||
|
sendItemDialogue(player!!, Items.COMBINATION_3102, "You have found the combination!").also { stage++ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
4 -> {
|
||||||
|
end()
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
openInterface(player!!, 220)
|
||||||
|
setInterfaceText(player!!, "<col=3D1E00>Red is North of Blue. Yellow is South of Purple.", 220, 7)
|
||||||
|
setInterfaceText(player!!, "<col=3D1E00>Green is North of Purple. Blue is West of", 220, 8)
|
||||||
|
setInterfaceText(player!!, "<col=3D1E00>Yellow. Purple is East of Red.", 220, 9)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
|
||||||
|
class SabaDialogueFile : DialogueFile() {
|
||||||
|
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
19 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> player(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.ANNOYED, "What?!").also { stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic(FacialExpression.THINKING, "I'm looking for the guard that was on the last night.", 10),
|
||||||
|
Topic(FacialExpression.THINKING, "Do you know of another way up Death Plateau?", 20),
|
||||||
|
Topic(FacialExpression.HALF_GUILTY, "Nothing, sorry!", END_DIALOGUE),
|
||||||
|
)
|
||||||
|
10 -> npcl(FacialExpression.ANNOYED,"Who?!").also { stage++ }
|
||||||
|
11 -> npcl(FacialExpression.ANNOYED,"Buzz off!").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
20 -> npcl(FacialExpression.ANNOYED,"Why would I want to go up there? I just want to be left in peace!").also { stage++ }
|
||||||
|
21 -> npcl(FacialExpression.ANNOYED,"It used to be just humans trampling past my cave and making a racket. Now there's those blasted trolls too! Not only do they stink and argue with each other loudly but they are always fighting the humans.").also { stage++ }
|
||||||
|
22 -> npcl(FacialExpression.ANNOYED,"I just want to be left in peace!").also { stage++ }
|
||||||
|
23 -> playerl(FacialExpression.FRIENDLY, "Ah... I might be able to help you.").also { stage++ }
|
||||||
|
24 -> npcl(FacialExpression.ANNOYED,"How?!").also { stage++ }
|
||||||
|
25 -> playerl(FacialExpression.HALF_THINKING, "I'm trying to help the...er...humans to reclaim back Death Plateau. If you help me then at least you'd be rid of the trolls.").also { stage++ }
|
||||||
|
26 -> npcl(FacialExpression.ANNOYED,"Hmph.").also { stage++ }
|
||||||
|
27 -> npcl(FacialExpression.ANNOYED,"Let me see...").also { stage++ }
|
||||||
|
28 -> npcl(FacialExpression.HALF_GUILTY,"I've only been up Death Plateau once to complain about the noise but those pesky trolls started throwing rocks at me!").also { stage++ }
|
||||||
|
29 -> npcl(FacialExpression.HALF_GUILTY,"Before the trolls came there used to be a nettlesome Sherpa that took humans exploring or something equally stupid. Perhaps he'd know another way.").also { stage++ }
|
||||||
|
30 -> playerl(FacialExpression.FRIENDLY, "Where does this Sherpa live?").also { stage++ }
|
||||||
|
31 -> npcl(FacialExpression.ANNOYED,"I don't know but it can't be far as he used to be around all the time!").also {
|
||||||
|
setQuestStage(player!!, "Death Plateau", 20)
|
||||||
|
stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
20 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> playerl(FacialExpression.FRIENDLY, "Hello.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.ANNOYED, "Have you got rid of those pesky trolls yet?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "Where did you say this Sherpa was?").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.ANNOYED, "I dunno but he must live around here somewhere!").also {
|
||||||
|
stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 21 .. 26 -> {
|
||||||
|
when (stage) {
|
||||||
|
0 -> playerl(FacialExpression.FRIENDLY, "Hello.").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Have you got rid of those pesky trolls yet?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "I'm working on it!").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "Grr!").also {
|
||||||
|
stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.node.entity.Entity
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.world.map.zone.ZoneBorders
|
||||||
|
|
||||||
|
class SecretWayLocation : MapArea {
|
||||||
|
override fun defineAreaBorders(): Array<ZoneBorders> {
|
||||||
|
return arrayOf(ZoneBorders(2866, 3609, 2866, 3609))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun areaEnter(entity: Entity) {
|
||||||
|
if (entity is Player && questStage(entity, DeathPlateau.questName) == 25) {
|
||||||
|
sendPlayerDialogue(entity, "I think this is far enough, I can see Death Plateau and it looks like the trolls haven't found the path. I'd better go and tell Denulth.")
|
||||||
|
setQuestStage(entity, DeathPlateau.questName, 26)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,143 @@
|
||||||
|
package content.region.asgarnia.burthorpe.quest.deathplateau
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.DialogueFile
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
import core.game.node.item.Item
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
|
||||||
|
class TenzingDialogueFile : DialogueFile() {
|
||||||
|
|
||||||
|
override fun handle(componentID: Int, buttonID: Int) {
|
||||||
|
when (questStage(player!!, DeathPlateau.questName)) {
|
||||||
|
20 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hello. How can I help?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "I'm helping the Imperial Guard. They need to find a way to sneak up Death Plateau to destroy the troll camp! Saba seemed to think you'd be able to help.").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "Ah...Saba is still alive and kicking?").also { stage++ }
|
||||||
|
4 -> playerl(FacialExpression.FRIENDLY, "Yeh, he seemed very bitter.").also { stage++ }
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "That's Saba alright!").also { stage++ }
|
||||||
|
6 -> npcl(FacialExpression.FRIENDLY, "I do know of a secret way up to Death Plateau, the Imperial Guard would be able to use it at night and not be seen until it was too late!").also { stage++ }
|
||||||
|
7 -> npcl(FacialExpression.FRIENDLY, "I'd be happy to show you it if you do something for me first.").also { stage++ }
|
||||||
|
8 -> playerl(FacialExpression.FRIENDLY, "Name it.").also { stage++ }
|
||||||
|
9 -> npcl(FacialExpression.FRIENDLY, "I don't get into town much and I'm getting low on supplies. I need ten loaves of bread and ten cooked trout, that should see me through the winter.").also { stage++ }
|
||||||
|
10 -> playerl(FacialExpression.FRIENDLY, "Anything else?").also { stage++ }
|
||||||
|
11 -> npcl(FacialExpression.FRIENDLY, "Yes. My climbing boots need to have new spikes, so can you take them to Dunstan in Burthorpe? He always puts my spikes on for me.").also { stage++ }
|
||||||
|
12 -> showTopics(
|
||||||
|
Topic(FacialExpression.FRIENDLY, "OK, I'll get those for you.", 20 ),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "I'll find the secret way for myself.", 30 )
|
||||||
|
)
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "Thank you traveller!").also { stage++ }
|
||||||
|
21 -> sendItemDialogue(player!!, Items.CLIMBING_BOOTS_3105, "Tenzing has given you his Climbing boots.").also {
|
||||||
|
addItemOrDrop(player!!, Items.CLIMBING_BOOTS_3105, 1)
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 21)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
30 -> npcl(FacialExpression.ANNOYED, "Hmph.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 21 .. 23 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also {
|
||||||
|
if (inInventory(player!!, Items.CLIMBING_BOOTS_3105) || inInventory(player!!, Items.SPIKED_BOOTS_3107)) {
|
||||||
|
stage = 1
|
||||||
|
} else {
|
||||||
|
stage = 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Has Dunstan added spikes to my climbing boots yet?").also { stage++ }
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "No, not yet.").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "Well, when he has, bring the boots to me with ten loaves of bread and ten cooked trout. I have to prepare for the winter, after all.").also {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "Have you brought me the items I asked for?").also { stage++ }
|
||||||
|
6 -> playerl(FacialExpression.FRIENDLY, "I've lost the climbing boots.").also { stage++ }
|
||||||
|
7 -> npcl(FacialExpression.FRIENDLY, "These are expensive, do not lose another pair!").also { stage++ }
|
||||||
|
8 -> sendItemDialogue(player!!, Items.CLIMBING_BOOTS_3105, "Tenzing has given you his Climbing boots.").also {
|
||||||
|
addItemOrDrop(player!!, Items.CLIMBING_BOOTS_3105, 1)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
24 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Have you brought me the items I asked for?").also {
|
||||||
|
if (inInventory(player!!, Items.SPIKED_BOOTS_3107) && inInventory(player!!, Items.BREAD_2309, 10) && inInventory(player!!, Items.TROUT_333, 10)) {
|
||||||
|
stage = 3
|
||||||
|
} else {
|
||||||
|
stage = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "I don't have the:" +
|
||||||
|
(if(!inInventory(player!!, Items.SPIKED_BOOTS_3107)) " Spiked boots." else "") +
|
||||||
|
(if(!inInventory(player!!, Items.BREAD_2309, 10)) " Ten loaves of bread." else "") +
|
||||||
|
(if(!inInventory(player!!, Items.TROUT_333, 10)) " Ten cooked trout." else "")
|
||||||
|
).also {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
3 -> sendItemDialogue(player!!, Items.SPIKED_BOOTS_3107, "You give Tenzing the Spiked boots.").also {
|
||||||
|
if (removeItem(player!!, Item(Items.SPIKED_BOOTS_3107))) {
|
||||||
|
stage++
|
||||||
|
} else {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
4 -> sendDoubleItemDialogue(player!!, Items.BREAD_2309, Items.TROUT_333, "You give Tenzing the loaves of bread and the cooked trout.").also {
|
||||||
|
if (removeItem(player!!, Item(Items.BREAD_2309, 10)) && removeItem(player!!, Item(Items.TROUT_333, 10)) ) {
|
||||||
|
stage++
|
||||||
|
} else {
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
5 -> npcl(FacialExpression.FRIENDLY, "Thank you very much traveller. I'm now ready for the winter!").also { stage++ }
|
||||||
|
6 -> playerl(FacialExpression.FRIENDLY, "You said you would show me the secret way to Death Plateau?").also { stage++ }
|
||||||
|
7 -> npcl(FacialExpression.FRIENDLY, "Yes, of course! I drew up a map in case I ever needed to use it again.").also { stage++ }
|
||||||
|
8 -> sendDialogue(player!!, "Tenzing has given you a map of the secret way!").also {
|
||||||
|
addItemOrDrop(player!!, Items.SECRET_WAY_MAP_3104)
|
||||||
|
stage++
|
||||||
|
}
|
||||||
|
9 -> npcl(FacialExpression.FRIENDLY, "I don't think the Trolls have found the secret way yet, if they had I would've been attacked by now.").also { stage++ }
|
||||||
|
10 -> playerl(FacialExpression.FRIENDLY, "OK thanks but I think I'd better check the path. I don't want to send the Imperial Guards to their death!").also { stage++ }
|
||||||
|
11 -> npcl(FacialExpression.FRIENDLY, "You are wise for one so young.").also {
|
||||||
|
setQuestStage(player!!, DeathPlateau.questName, 25)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in 25.. 29 -> {
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.FRIENDLY, "Hello Tenzing!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.FRIENDLY, "Hello again traveller. What can I do for you?").also {
|
||||||
|
if (inInventory(player!!, Items.SECRET_WAY_MAP_3104)) {
|
||||||
|
stage = 10
|
||||||
|
} else {
|
||||||
|
stage = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
2 -> playerl(FacialExpression.FRIENDLY, "I've lost the secret way map.").also { stage++ }
|
||||||
|
3 -> npcl(FacialExpression.FRIENDLY, "Never mind. I'll quickly draw you another one.").also { stage++ }
|
||||||
|
4 -> sendDialogue(player!!, "Tenzing has given you a map of the secret way!").also {
|
||||||
|
addItemOrDrop(player!!, Items.SECRET_WAY_MAP_3104)
|
||||||
|
stage = END_DIALOGUE
|
||||||
|
}
|
||||||
|
|
||||||
|
10 -> showTopics(
|
||||||
|
Topic(FacialExpression.FRIENDLY, "I'm lost!", 20 ),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Nothing, thanks.", 30 )
|
||||||
|
)
|
||||||
|
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "To get back to Burthorpe follow the path going east.").also { stage++ }
|
||||||
|
21 -> npcl(FacialExpression.FRIENDLY, "I thought you were going to investigate the secret way to Death Plateau? Use the back door to my hut, hop over the stile and follow that path.").also { stage++ }
|
||||||
|
22 -> playerl(FacialExpression.FRIENDLY, "Oh yes, of course! Thanks!").also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
30 -> npcl(FacialExpression.FRIENDLY, "Go in peace traveller.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package content.region.asgarnia.trollheim.dialogue
|
||||||
|
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.SabaDialogueFile
|
||||||
|
import core.api.openDialogue
|
||||||
|
import core.api.questStage
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the dialogue plugin used for the tenzing npc.
|
||||||
|
* @author 'Vexia
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Initializable
|
||||||
|
class SabaDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
if (questStage(player!!, DeathPlateau.questName) >= 19) {
|
||||||
|
openDialogue(player!!, SabaDialogueFile(), npc)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Fallback to default.
|
||||||
|
when (stage) {
|
||||||
|
START_DIALOGUE -> playerl(FacialExpression.HALF_GUILTY, "Hi!").also { stage++ }
|
||||||
|
1 -> npcl(FacialExpression.ANNOYED, "Why won't people leave me alone?!").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return SabaDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.SABA_1070)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
package content.region.asgarnia.trollheim.dialogue
|
||||||
|
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.DeathPlateau
|
||||||
|
import content.region.asgarnia.burthorpe.quest.deathplateau.TenzingDialogueFile
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.item.Item
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the dialogue plugin used for the tenzing npc.
|
||||||
|
* @author 'Vexia
|
||||||
|
* @author ovenbread
|
||||||
|
*/
|
||||||
|
@Initializable
|
||||||
|
class TenzingDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
if (isQuestInProgress(player!!, DeathPlateau.questName, 20, 29)) {
|
||||||
|
openDialogue(player!!, TenzingDialogueFile(), npc)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// Fallback to default.
|
||||||
|
when (stage) {
|
||||||
|
0 -> player(FacialExpression.FRIENDLY, "Hello Tenzing!").also { stage++ }
|
||||||
|
1 -> npc(FacialExpression.FRIENDLY,"Hello traveler. What can I do for you?").also{ stage++ }
|
||||||
|
2 -> showTopics(
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Can I buy some Climbing boots?", 10),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "What does a Sherpa do?", 20),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "How did you find out about the secret way?", 30),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Nice place you have here.", 40),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "Nothing, thanks!", END_DIALOGUE)
|
||||||
|
)
|
||||||
|
10 -> npc("Sure, I'll sell you some in your size for 12 gold.").also{ stage++ }
|
||||||
|
11 -> showTopics(
|
||||||
|
Topic(FacialExpression.FRIENDLY, "OK, sounds good.", 12),
|
||||||
|
Topic(FacialExpression.FRIENDLY, "No, thanks.", END_DIALOGUE),
|
||||||
|
)
|
||||||
|
12 -> {
|
||||||
|
if (!player.inventory.hasSpaceFor(Item(Items.CLIMBING_BOOTS_3105))) {
|
||||||
|
player("I don't have enough space in my backpack right this second.").also{ stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
if (!inInventory(player, Items.COINS_995)) {
|
||||||
|
player("I don't have enough coins right now.").also{ stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
if (removeItem(player!!, Item(Items.COINS_995, 12))) {
|
||||||
|
player("I don't have enough coins right now.").also{ stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
addItemOrDrop(player, Items.CLIMBING_BOOTS_3105, 1)
|
||||||
|
sendItemDialogue(player, Items.CLIMBING_BOOTS_3105, "Tenzing has given you some Climbing boots.").also { stage = END_DIALOGUE }
|
||||||
|
sendMessage(player, "Tenzing has given you some Climbing boots.")
|
||||||
|
}
|
||||||
|
|
||||||
|
20 -> npcl(FacialExpression.FRIENDLY, "We are expert guides that take adventurers such as yourself, on mountaineering expeditions.").also { stage = END_DIALOGUE }
|
||||||
|
30 -> npcl(FacialExpression.FRIENDLY, "I used to take adventurers up Death Plateau and further north before the trolls came. I know these mountains well.").also { stage = END_DIALOGUE }
|
||||||
|
40 -> npcl(FacialExpression.FRIENDLY, "Thanks, I built it myself! I'm usually self sufficient but I can't earn any money with the trolls camped on Death Plateau,").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun newInstance(player: Player): DialoguePlugin {
|
||||||
|
return TenzingDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.TENZING_1071)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -156,11 +156,9 @@ public final class TrollheimPlugin extends OptionHandler {
|
||||||
// ladder
|
// ladder
|
||||||
SceneryDefinition.forId(18833).getHandlers().put("option:climb-down", this);// stronghold
|
SceneryDefinition.forId(18833).getHandlers().put("option:climb-down", this);// stronghold
|
||||||
// ladder
|
// ladder
|
||||||
ClassScanner.definePlugin(new SabaDialogue());
|
|
||||||
ClassScanner.definePlugin(new WoundedSoldier());
|
ClassScanner.definePlugin(new WoundedSoldier());
|
||||||
ClassScanner.definePlugin(new WarningZone());
|
ClassScanner.definePlugin(new WarningZone());
|
||||||
ActivityManager.register(new WarningCutscene());
|
ActivityManager.register(new WarningCutscene());
|
||||||
ClassScanner.definePlugin(new TenzingDialogue());
|
|
||||||
ClassScanner.definePlugin(new TrollNPC());
|
ClassScanner.definePlugin(new TrollNPC());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
@ -432,62 +430,6 @@ public final class TrollheimPlugin extends OptionHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the saba dialogue plugin.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public final class SabaDialogue extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code TrolleimPlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public SabaDialogue() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code TrolleimPlugin} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public SabaDialogue(final Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new SabaDialogue(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
player("Hello!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
npc("Why won't people leave me alone?!");
|
|
||||||
stage = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 1070 };
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the wounded soldiers dialogue plugin.
|
* Represents the wounded soldiers dialogue plugin.
|
||||||
* @author 'Vexia
|
* @author 'Vexia
|
||||||
|
|
@ -697,156 +639,6 @@ public final class TrollheimPlugin extends OptionHandler {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the dialogue plugin used for the tenzing npc.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
public static final class TenzingDialogue extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the coins items.
|
|
||||||
*/
|
|
||||||
private static final Item COINS = new Item(995, 12);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code TenzingDialogue} {@code Object}.
|
|
||||||
*/
|
|
||||||
public TenzingDialogue() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code TenzingDialogue} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public TenzingDialogue(final Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new TenzingDialogue(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
player("Hello Tenzing!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
npc("Hello traveler. What can I do for you?");
|
|
||||||
stage = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
options("Can I buy some Climbing boots?", "What does a Sherpa do?", "How did you find out about the secret way?", "Nice place you have here.", "Nothing, thanks!");
|
|
||||||
stage = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
switch (buttonId) {
|
|
||||||
case 1:
|
|
||||||
player("Can I buy some Climbing boots?");
|
|
||||||
stage = 10;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
player("What does a Sherpa do?");
|
|
||||||
stage = 20;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
player("How did you find out about the secret way?");
|
|
||||||
stage = 30;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
player("Nice place you have here.");
|
|
||||||
stage = 40;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
player("Nothing, thanks!");
|
|
||||||
stage = 50;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
npc("Sure, I'll sell you some in your size for 12 gold.");
|
|
||||||
stage = 11;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
options("OK, sounds good.", "No, thanks.");
|
|
||||||
stage = 12;
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
switch (buttonId) {
|
|
||||||
case 1:
|
|
||||||
player("OK, sounds good.");
|
|
||||||
stage = 13;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
player("No, thanks.");
|
|
||||||
stage = 50;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
if (!player.getInventory().hasSpaceFor(CLIMBING_BOOTS)) {
|
|
||||||
player("I don't have enough space in my backpack right", "this second.");
|
|
||||||
stage = 50;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!player.getInventory().containsItem(COINS)) {
|
|
||||||
end();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!player.getInventory().remove(COINS)) {
|
|
||||||
player("I don't have enough coins right now.");
|
|
||||||
stage = 50;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (player.getInventory().add(CLIMBING_BOOTS)) {
|
|
||||||
interpreter.sendItemMessage(CLIMBING_BOOTS, "Tenzing has given you some Climbing boots.");
|
|
||||||
player.getPacketDispatch().sendMessage("Tenzing has given you some Climbing boots.");
|
|
||||||
}
|
|
||||||
stage = 50;
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
npc("We are expert guides that take adventurers such as", "yourself, on mountaineering expeditions.");
|
|
||||||
stage = 21;
|
|
||||||
break;
|
|
||||||
case 21:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
npc("I used to take adventurers up Death Plateau and", "further north before the trolls came. I know these", "mountains well.");
|
|
||||||
stage = 31;
|
|
||||||
break;
|
|
||||||
case 31:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 40:
|
|
||||||
npc("Thanks, I built it myself! I'm usually self sufficient but", "I can't earn any money with the trolls camped on", "Death Plateau,");
|
|
||||||
stage = 41;
|
|
||||||
break;
|
|
||||||
case 41:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 50:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 1071 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the a trollheim troll.
|
* Represents the a trollheim troll.
|
||||||
* @author 'Vexia
|
* @author 'Vexia
|
||||||
|
|
|
||||||
|
|
@ -1363,6 +1363,17 @@ fun setInterfaceText(player: Player, string: String, iface: Int, child: Int) {
|
||||||
player.packetDispatch.sendString(string, iface, child)
|
player.packetDispatch.sendString(string, iface, child)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows you to hide or show specific children in an interface
|
||||||
|
* @param player the player to send the packet to
|
||||||
|
* @param iface the ID of the interface to use
|
||||||
|
* @param child the index of the child to hide or show
|
||||||
|
* @param hide if the child should be hidden or not
|
||||||
|
*/
|
||||||
|
fun setComponentVisibility(player: Player, iface: Int, child: Int, hide: Boolean) {
|
||||||
|
player.packetDispatch.sendInterfaceConfig(iface, child, hide)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes any open (non-chat) interfaces for the player
|
* Closes any open (non-chat) interfaces for the player
|
||||||
* @param player the player to close the interface for
|
* @param player the player to close the interface for
|
||||||
|
|
@ -1579,6 +1590,13 @@ fun setQuestStage(player: Player, quest: String, stage: Int) {
|
||||||
player.questRepository.syncronizeTab(player)
|
player.questRepository.syncronizeTab(player)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a quest is in progress
|
||||||
|
*/
|
||||||
|
fun isQuestInProgress(player: Player, quest: String, startStage: Int, endStage: Int): Boolean {
|
||||||
|
return player.questRepository.getStage(quest) in startStage..endStage
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a quest is complete
|
* Check if a quest is complete
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue