mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Rewrote Doric's Quest
This commit is contained in:
parent
9b08f2175b
commit
3cf73ba09a
7 changed files with 335 additions and 337 deletions
|
|
@ -1,5 +1,7 @@
|
|||
package content.region.asgarnia.dwarfmine.dialogue
|
||||
|
||||
import core.api.getAttribute
|
||||
import core.api.setAttribute
|
||||
import core.game.dialogue.DialoguePlugin
|
||||
import core.game.dialogue.FacialExpression
|
||||
import core.game.node.entity.npc.NPC
|
||||
|
|
@ -30,9 +32,19 @@ class NurmofDialogue(player: Player? = null) : core.game.dialogue.DialoguePlugin
|
|||
3 -> player(core.game.dialogue.FacialExpression.HALF_ASKING, "Are your pickaxes better than other pickaxes, then?").also { stage = 10 }
|
||||
}
|
||||
|
||||
10 -> npcl(core.game.dialogue.FacialExpression.OLD_NORMAL,"Of course they are! My pickaxes are made of higher grade metal than your ordinary bronze pickaxes, allowing you to mine ore just that little bit faster.").also { stage = 99 }
|
||||
|
||||
99 -> end()
|
||||
10 -> npcl(core.game.dialogue.FacialExpression.OLD_NORMAL,"Of course they are! My pickaxes are made of higher grade metal than your ordinary bronze pickaxes, allowing you to mine ore just that little bit faster.").also {
|
||||
if(!getAttribute(player, "pre-dq:said-hi", true)) {
|
||||
stage++
|
||||
} else {
|
||||
stage = 99
|
||||
}
|
||||
}
|
||||
11 -> playerl(core.game.dialogue.FacialExpression.FRIENDLY, "By the way, Doric says hello!").also { stage++ }
|
||||
12 -> npcl(core.game.dialogue.FacialExpression.OLD_HAPPY, "Oh! Thank you for telling me, adventurer!").also { stage = 99 }
|
||||
99 -> {
|
||||
setAttribute(player, "pre-dq:said-hi", true)
|
||||
end()
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,261 +0,0 @@
|
|||
package content.region.asgarnia.falador.dialogue;
|
||||
|
||||
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.node.entity.player.link.quest.Quest;
|
||||
import core.game.node.item.GroundItemManager;
|
||||
import core.game.node.item.Item;
|
||||
import core.plugin.Initializable;
|
||||
import core.game.world.GameWorld;
|
||||
|
||||
/**
|
||||
* Represents the dialogue plugin used for the doric npc.
|
||||
* @author 'Vexia
|
||||
* @version 1.0
|
||||
*/
|
||||
@Initializable
|
||||
public final class DoricDialogue extends DialoguePlugin {
|
||||
|
||||
/**
|
||||
* Represents the pickaxe item.
|
||||
*/
|
||||
private static final Item PICKAXE = new Item(1265, 1);
|
||||
|
||||
/**
|
||||
* Represents the requirement items.
|
||||
*/
|
||||
private static final Item[] REQUIREMENTS = new Item[] { new Item(436, 4), new Item(434, 6), new Item(440, 2) };
|
||||
|
||||
/**
|
||||
* Constructs a new {@code DoricDialogue} {@code Object}.
|
||||
*/
|
||||
public DoricDialogue() {
|
||||
/**
|
||||
* empty.
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code DoricDialogue} {@code Object}.
|
||||
* @param player the player.
|
||||
*/
|
||||
public DoricDialogue(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DialoguePlugin newInstance(Player player) {
|
||||
return new DoricDialogue(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean open(Object... args) {
|
||||
npc = (NPC) args[0];
|
||||
final Quest quest = player.getQuestRepository().getQuest("Doric's Quest");
|
||||
if (!quest.isStarted(player)) {
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Hello traveller, what brings you to my humble smithy?");
|
||||
stage = 0;
|
||||
}
|
||||
if (quest.isStarted(player)) {
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Have you got my materials yet, traveller?");
|
||||
stage = 100;
|
||||
}
|
||||
if (quest.isCompleted(player)) {
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Hello traveller, how is your metalworking coming along?");
|
||||
stage = 500;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(int interfaceId, int buttonId) {
|
||||
switch (stage) {
|
||||
case 0:
|
||||
interpreter.sendOptions("Select an Option", "I wanted to use your anvils.", "I want to use your whetstone.", "Mind your own business, shortstuff!", "I was just checking out the landscape.", "What do you make here?");
|
||||
stage = 1;
|
||||
break;
|
||||
case 1:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.NEUTRAL, "I wanted to use your anvils.");
|
||||
stage = 10;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.NEUTRAL, "I want to use your whetsone.");
|
||||
stage = 20;
|
||||
break;
|
||||
case 3:
|
||||
interpreter.sendDialogues(player, FacialExpression.ANNOYED, "Mind your own business, shortstuff!");
|
||||
stage = 30;
|
||||
break;
|
||||
case 4:
|
||||
interpreter.sendDialogues(player, FacialExpression.FRIENDLY, "I was just checking out the landscape.");
|
||||
stage = 40;
|
||||
break;
|
||||
case 5:
|
||||
interpreter.sendDialogues(player, FacialExpression.ASKING, "What do you make here?");
|
||||
stage = 50;
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "My anvils get enough work with my own use. I make", "pickaxes, and it takes a lot of hard work. If you could", "get me some more materials, then I could let you use", "them.");
|
||||
stage = 11;
|
||||
break;
|
||||
case 11:
|
||||
interpreter.sendOptions("Select an Option", "Yes, I will get you the materials.", "No, hitting rocks if for the boring people, sorry.");
|
||||
stage = 12;
|
||||
break;
|
||||
case 12:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.FRIENDLY, "Yes I will get you the materials.");
|
||||
stage = 15;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.NEUTRAL, "No, hitting rocks is for the boring people, sorry.");
|
||||
stage = 13;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "That is your choice. Nice to meet you anyway.");
|
||||
stage = 14;
|
||||
break;
|
||||
case 14:
|
||||
end();
|
||||
break;
|
||||
case 15:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Clay is what I use more than anything, to make casts.", "Could you get me 6 clay, 4 copper ore, and 2 iron ore,", "please? I could pay a little, and let you use my anvils.", "Take this pickaxe with you just in case you need it.");
|
||||
stage = 16;
|
||||
break;
|
||||
case 16:
|
||||
player.getQuestRepository().getQuest("Doric's Quest").setStage(player, 1);
|
||||
player.getQuestRepository().syncronizeTab(player);
|
||||
if (!player.getInventory().add(PICKAXE)) {
|
||||
GroundItemManager.create(PICKAXE, player.getLocation());
|
||||
}
|
||||
interpreter.sendDialogues(player, FacialExpression.FRIENDLY, "Certainly, I'll be right back!");
|
||||
stage = 17;
|
||||
break;
|
||||
case 17:
|
||||
end();
|
||||
break;
|
||||
case 20:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "The whetstone is for more advanced smithing, but I", "could let you use it as well as my anvils if you could", "get me some more materials.");
|
||||
stage = 11;
|
||||
break;
|
||||
case 30:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "How nice to meet someone with such pleasant manners.", "Do come again when you need to shout at someone", "smaller than you!");
|
||||
stage = 31;
|
||||
break;
|
||||
case 31:
|
||||
end();
|
||||
break;
|
||||
case 40:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Hope you like it. I do enjoy the solitude of my little", "home. If you get time, please say hi to my friends in", "the Dwarven Mine.");
|
||||
stage = 41;
|
||||
break;
|
||||
case 41:
|
||||
interpreter.sendDialogues(player, FacialExpression.HAPPY, "Will do!");
|
||||
stage = 42;
|
||||
break;
|
||||
case 42:
|
||||
end();
|
||||
break;
|
||||
case 50:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "I make pickaxes. I am the best maker of pickaxes in the", "whole of " + GameWorld.getSettings().getName() + ".");
|
||||
stage = 51;
|
||||
break;
|
||||
case 51:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_ASKING, "Do you have any to sell?");
|
||||
stage = 52;
|
||||
break;
|
||||
case 52:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Sorry, but I've got a running order with Nurmof.");
|
||||
stage = 53;
|
||||
break;
|
||||
case 53:
|
||||
interpreter.sendDialogues(player, FacialExpression.NEUTRAL, "Ah, fair enough.");
|
||||
stage = 54;
|
||||
break;
|
||||
case 54:
|
||||
end();
|
||||
break;
|
||||
case 100:
|
||||
if (player.getInventory().contains(434, 6) && player.getInventory().contains(440, 2) && player.getInventory().contains(436, 4)) {
|
||||
interpreter.sendDialogues(player, FacialExpression.HAPPY, "I have everything you need.");
|
||||
stage = 200;
|
||||
} else {
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Sorry, I don't have them all yet.");
|
||||
stage = 101;
|
||||
}
|
||||
break;
|
||||
case 101:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Not to worry, stick at it. Remember, I need 6 clay, 4", "copper ore, and 2 iron ore.");
|
||||
stage = 102;
|
||||
break;
|
||||
case 102:
|
||||
interpreter.sendOptions("Select an Option", "Where can I find those?", "Certainly, I'll be right back.");
|
||||
stage = 103;
|
||||
break;
|
||||
case 103:
|
||||
switch (buttonId) {
|
||||
case 1:
|
||||
interpreter.sendDialogues(player, FacialExpression.HALF_ASKING, "Where can I find those?");
|
||||
stage = 110;
|
||||
break;
|
||||
case 2:
|
||||
interpreter.sendDialogues(player, FacialExpression.HAPPY, "Certainly, I'll be right back.");
|
||||
stage = 113;
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
case 110:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "You'll be able to find all those ores in the rocks just", "inside the Dwarven Mine. Head east from here and", "you'll find the entrance in the side of Ice Mountain.");
|
||||
stage = 111;
|
||||
break;
|
||||
case 111:
|
||||
end();
|
||||
break;
|
||||
case 113:
|
||||
end();
|
||||
break;
|
||||
case 200:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Many thanks. Pass them here, please. I can spare you", "some coins for your trouble, and please use my anvils", "anytime you want.");
|
||||
stage = 201;
|
||||
break;
|
||||
case 201:
|
||||
interpreter.sendItemMessage(436, "You hand the clay, copper, and iron to Doric.");
|
||||
stage = 202;
|
||||
break;
|
||||
case 202:
|
||||
if (player.getInventory().remove(REQUIREMENTS)) {
|
||||
end();
|
||||
player.getQuestRepository().getQuest("Doric's Quest").finish(player);
|
||||
}
|
||||
break;
|
||||
case 500:
|
||||
interpreter.sendDialogues(player, FacialExpression.NEUTRAL, "Not too bad, Doric.");
|
||||
stage = 501;
|
||||
break;
|
||||
case 501:
|
||||
interpreter.sendDialogues(npc, FacialExpression.OLD_NORMAL, "Good, the love of metal is a thing close to my heart.");
|
||||
stage = 502;
|
||||
break;
|
||||
case 502:
|
||||
end();
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIds() {
|
||||
return new int[] { 284 };
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
package content.region.asgarnia.falador.dialogue
|
||||
|
||||
import content.region.asgarnia.falador.quest.doricsquest.DoricDoricsQuestDialogue
|
||||
import core.api.*
|
||||
import core.game.activity.Cutscene
|
||||
import core.game.dialogue.DialoguePlugin
|
||||
import core.game.dialogue.FacialExpression
|
||||
import core.game.dialogue.IfTopic
|
||||
import core.game.dialogue.Topic
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.world.GameWorld.settings
|
||||
import core.game.world.map.Direction
|
||||
import core.game.world.map.Location
|
||||
import core.plugin.Initializable
|
||||
import core.tools.END_DIALOGUE
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
@Initializable
|
||||
class DoricDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||
override fun open(vararg args: Any?): Boolean {
|
||||
npc = args[0] as NPC
|
||||
val qStage = getQuestStage(player, "Doric's Quest")
|
||||
if(qStage == 0) {
|
||||
npcl(FacialExpression.OLD_NORMAL, "Hello traveller, what brings you to my humble smithy?").also { stage = 0 }
|
||||
} else if(qStage in 1..99) {
|
||||
openDialogue(player, DoricDoricsQuestDialogue(30), npc)
|
||||
} else {
|
||||
npcl(FacialExpression.OLD_HAPPY, "Hello traveller, how is your metalworking coming along?").also { stage = 60 }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||
when(stage) {
|
||||
0 -> showTopics(
|
||||
Topic(FacialExpression.FRIENDLY, "I wanted to use your anvils.", 10),
|
||||
Topic(FacialExpression.FRIENDLY, "I wanted to use your whetstone.", 20),
|
||||
IfTopic(FacialExpression.ANNOYED, "Mind your own business, shortstuff!", 30, !getAttribute(player, "pre-dq:doric-calm", false), true),
|
||||
Topic(FacialExpression.FRIENDLY, "I was just checking out the landscape.", 40),
|
||||
Topic(FacialExpression.ASKING, "What do you make here?", 50)
|
||||
)
|
||||
|
||||
10 -> openDialogue(player, DoricDoricsQuestDialogue(10), npc)
|
||||
|
||||
20 -> openDialogue(player, DoricDoricsQuestDialogue(20), npc)
|
||||
|
||||
30 -> {
|
||||
if(getAttribute(player, "pre-dq:doric-angy-count", 0) == 10) {
|
||||
end()
|
||||
PDC(player).start()
|
||||
} else {
|
||||
setAttribute(player, "/save:pre-dq:doric-angy-count", getAttribute(player, "pre-dq:doric-angy-count", 0) + 1)
|
||||
npcl(FacialExpression.OLD_ANGRY1, "How nice to meet someone with such pleasant manners. Do come again when you need to shout at someone smaller than you!").also { stage = END_DIALOGUE }
|
||||
}
|
||||
}
|
||||
|
||||
40 -> {
|
||||
npcl(FacialExpression.OLD_HAPPY, "Hope you like it. I do enjoy the solitude of my little home. If you get time, please say hi to my friends in the Dwarven Mine.")
|
||||
setAttribute(player, "/save:pre-dq:said-hi", false)
|
||||
stage = END_DIALOGUE
|
||||
}
|
||||
|
||||
50 -> npcl(FacialExpression.OLD_NORMAL, "I make pickaxes. I am the best maker of pickaxes in the whole of ${settings!!.name}.").also { stage++ }
|
||||
51 -> playerl(FacialExpression.HALF_ASKING, "Do you have any to sell?").also { stage++ }
|
||||
52 -> npcl(FacialExpression.OLD_NOT_INTERESTED, "Sorry, but I've got a running order with Nurmof.").also { stage++ }
|
||||
53 -> playerl(FacialExpression.FRIENDLY, "Ah, fair enough.").also { stage = END_DIALOGUE }
|
||||
|
||||
60 -> playerl(FacialExpression.FRIENDLY, "Not too bad, Doric.").also { stage++ }
|
||||
61 -> npcl(FacialExpression.OLD_HAPPY, "Good, the love of metal is a thing close to my heart.").also { stage++ }
|
||||
62 -> {
|
||||
if(getAttribute(player, "pre-dq:said-hi", false)) {
|
||||
playerl(FacialExpression.FRIENDLY, "By the way, I told Nurmof you said hello.")
|
||||
stage++
|
||||
} else {
|
||||
end()
|
||||
}
|
||||
}
|
||||
63 -> {
|
||||
npcl(FacialExpression.OLD_HAPPY, "Thank you traveller! You'll always be welcome in my home.")
|
||||
removeAttribute(player, "pre-dq:said-hi")
|
||||
rewardXP(player, Skills.MINING, 5.0)
|
||||
stage = END_DIALOGUE
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getIds(): IntArray {
|
||||
return intArrayOf(NPCs.DORIC_284)
|
||||
}
|
||||
}
|
||||
|
||||
class PDC(player: Player) : Cutscene(player) {
|
||||
override fun setup() {
|
||||
setExit(Location(2952, 3450))
|
||||
loadRegion(11829)
|
||||
addNPC(NPCs.DORIC_284, 9, 58, Direction.WEST)
|
||||
}
|
||||
|
||||
override fun runStage(stage: Int) {
|
||||
when(stage) {
|
||||
0 -> {
|
||||
fadeToBlack()
|
||||
timedUpdate(6)
|
||||
}
|
||||
1 -> {
|
||||
teleport(player, 8, 58)
|
||||
moveCamera(6, 60, 250)
|
||||
rotateCamera(8, 58, 75)
|
||||
player.faceLocation(getNPC(NPCs.DORIC_284)!!.location)
|
||||
getNPC(NPCs.DORIC_284)!!.faceLocation(player.location)
|
||||
timedUpdate(2)
|
||||
}
|
||||
2 -> {
|
||||
fadeFromBlack()
|
||||
getNPC(NPCs.DORIC_284)!!.faceLocation(player.location)
|
||||
timedUpdate(2)
|
||||
}
|
||||
3 -> {
|
||||
sendChat(player, "Mind your own business, shortstuff!")
|
||||
timedUpdate(6)
|
||||
}
|
||||
4 -> {
|
||||
sendChat(getNPC(NPCs.DORIC_284)!!, "I guess your mother never taught you manners. Lucky for you, I'll do just that!")
|
||||
timedUpdate(5)
|
||||
}
|
||||
5 -> {
|
||||
animate(getNPC(NPCs.DORIC_284)!!, 99)
|
||||
timedUpdate(1)
|
||||
}
|
||||
6 -> {
|
||||
animate(player, 837)
|
||||
timedUpdate(4)
|
||||
}
|
||||
7 -> {
|
||||
animate(player, 838)
|
||||
timedUpdate(2)
|
||||
}
|
||||
8 -> {
|
||||
fadeToBlack()
|
||||
timedUpdate(5)
|
||||
}
|
||||
9 -> {
|
||||
animate(player, 0)
|
||||
timedUpdate(1)
|
||||
}
|
||||
10 -> {
|
||||
animate(player, 856)
|
||||
fadeFromBlack()
|
||||
timedUpdate(2)
|
||||
}
|
||||
11 -> {
|
||||
sendChat(player, "Okay, I'm sorry!")
|
||||
animate(player, 856)
|
||||
timedUpdate(5)
|
||||
}
|
||||
12 -> {
|
||||
sendChat(getNPC(NPCs.DORIC_284)!!, "That's what I thought. Watch your mouth the next time you speak to me.")
|
||||
timedUpdate(3)
|
||||
}
|
||||
13 -> {
|
||||
end {
|
||||
setAttribute(player, "/save:pre-dq:doric-calm", true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
package content.region.asgarnia.falador.quest;
|
||||
|
||||
import core.game.node.entity.skill.Skills;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.quest.Quest;
|
||||
import core.game.node.item.GroundItemManager;
|
||||
import core.game.node.item.Item;
|
||||
import core.plugin.Initializable;
|
||||
|
||||
/**
|
||||
* Represents the Doric's Quest
|
||||
* @author Vexia
|
||||
*
|
||||
*/
|
||||
@Initializable
|
||||
public class DoricsQuest extends Quest {
|
||||
|
||||
/**
|
||||
* Constructs a new {@Code DoricsQuest} {@Code Object}
|
||||
*/
|
||||
public DoricsQuest() {
|
||||
super("Doric's Quest", 17, 16, 1, 31, 0, 1, 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Quest newInstance(Object object) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawJournal(Player player, int stage) {
|
||||
super.drawJournal(player, stage);
|
||||
switch (stage) {
|
||||
case 0:
|
||||
player.getPacketDispatch().sendString("<col=08088A>I can start this quest by speaking to <col=8A0808>Doric</col> <col=08088A>who is <col=8A0808>North of", 275, 4+ 7);
|
||||
player.getPacketDispatch().sendString("<col=8A0808>Falador", 275, 5+ 7);
|
||||
player.getPacketDispatch().sendString("<col=08088A>There aren't any requirements but <col=8A0808>Level 15 Mining <col=08088A>will help", 275, 7+ 7);
|
||||
break;
|
||||
case 1:
|
||||
player.getPacketDispatch().sendString("<str>I have spoken to <col=8A0808>Doric</str>", 275, 4+ 7);
|
||||
player.getPacketDispatch().sendString("<col=08088A>I need to collect some items and bring them to <col=8A0808>Doric</col>", 275, 6+ 7);
|
||||
player.getPacketDispatch().sendString(player.getInventory().contains(434, 6) ? "<str>6 Clay</str>" : "<col=8A0808>6 Clay", 275, 7+ 7);
|
||||
player.getPacketDispatch().sendString(player.getInventory().contains(436, 4) ? "<str>4 Copper Ore</str>" : "<col=8A0808>4 Copper Ore", 275, 8+ 7);
|
||||
player.getPacketDispatch().sendString(player.getInventory().contains(440, 2) ? "<str>2 Iron Ore</str>" : "<col=8A0808>2 Iron Ore", 275, 9+ 7);
|
||||
break;
|
||||
case 100:
|
||||
player.getPacketDispatch().sendString("<str>I have spoken to <col=8A0808>Doric</str>", 275, 4+ 7);
|
||||
player.getPacketDispatch().sendString("<col=FF0000>QUEST COMPLETE!", 275, 10+ 7);
|
||||
player.getPacketDispatch().sendString("<str> I have collected some Clay, Copper Ore, and Iron Ore", 275, 6+ 7);
|
||||
player.getPacketDispatch().sendString("<str>Doric rewarded me for all my hard work", 275, 8+ 7);
|
||||
player.getPacketDispatch().sendString("<str>I can now use Doric's Anvils whenever I want", 275, 9+ 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish(Player player) {
|
||||
super.finish(player);
|
||||
player.getPacketDispatch().sendString("1 Quest Point", 277, 8 + 2);
|
||||
player.getPacketDispatch().sendString("1300 Mining XP", 277, 9 + 2);
|
||||
player.getPacketDispatch().sendString("180 coins", 277, 10 + 2);
|
||||
player.getPacketDispatch().sendString("Use of Doric's Anvils", 277, 11 + 2);
|
||||
if (!player.getInventory().add(new Item(995, 180))) {
|
||||
GroundItemManager.create(new Item(995, 180), player.getLocation());
|
||||
}
|
||||
player.getSkills().addExperience(Skills.MINING, 1300);
|
||||
player.getPacketDispatch().sendItemZoomOnInterface(1269, 240, 277, 5);
|
||||
player.getInterfaceManager().closeChatbox();
|
||||
player.getPacketDispatch().sendString("You have completed Doric's Quest!", 277, 2 + 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package content.region.asgarnia.falador.quest.doricsquest
|
||||
|
||||
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.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.tools.END_DIALOGUE
|
||||
import org.rs09.consts.Items
|
||||
import org.rs09.consts.NPCs
|
||||
|
||||
class DoricDoricsQuestDialogue(val dStage: Int) : DialogueFile() {
|
||||
override fun handle(componentID: Int, buttonID: Int) {
|
||||
when(dStage) {
|
||||
10 -> handleQuestStartDialogue(player, false)
|
||||
20 -> handleQuestStartDialogue(player, true)
|
||||
30 -> handleGiveDoricItemsDialogue(player)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleQuestStartDialogue(player: Player?, isWhetstone: Boolean) {
|
||||
player ?: return
|
||||
when(stage) {
|
||||
0 -> {
|
||||
if(!isWhetstone) {
|
||||
npcl(FacialExpression.OLD_NORMAL, "My anvils get enough work with my own use. I make pickaxes, and it takes a lot of hard work. If you could get me some more materials, then I could let you use them.")
|
||||
stage = 30
|
||||
} else {
|
||||
npcl(FacialExpression.OLD_NORMAL, "The whetstone is for more advanced smithing, but I could let you use it as well as my anvils if you could get me some more materials.")
|
||||
stage = 30
|
||||
}
|
||||
}
|
||||
30 -> showTopics(
|
||||
Topic(FacialExpression.FRIENDLY, "Yes I will get you the materials.", 40),
|
||||
Topic(FacialExpression.HALF_GUILTY, "No, hitting rocks is for the boring people, sorry.", 100)
|
||||
)
|
||||
// Yes, this has to be npc, not npcl
|
||||
40 -> npc(FacialExpression.OLD_NORMAL, "Clay is what I use more than anything, to make casts.", "Could you get me 6 clay, 4 copper ore, and 2 iron ore,", "please? I could pay a little, and let you use my anvils.", "Take this pickaxe with you just in case you need it.").also { stage++ }
|
||||
41 -> {
|
||||
playerl(FacialExpression.FRIENDLY, "Certainly, I'll be right back!")
|
||||
startQuest(player, "Doric's Quest")
|
||||
if(!inInventory(player, Items.BRONZE_PICKAXE_1265)) addItemOrDrop(player, Items.BRONZE_PICKAXE_1265)
|
||||
stage = END_DIALOGUE
|
||||
}
|
||||
100 -> npcl(FacialExpression.OLD_NORMAL, "That is your choice. Nice to meet you anyway.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleGiveDoricItemsDialogue(player: Player?) {
|
||||
player ?: return
|
||||
when(stage) {
|
||||
0 -> npcl(FacialExpression.OLD_NORMAL, "Have you got my materials yet, traveller?").also { stage++ }
|
||||
1 -> {
|
||||
if(inInventory(player, Items.CLAY_434, 6) && inInventory(player, Items.COPPER_ORE_436, 4) && inInventory(player, Items.IRON_ORE_440, 2)) {
|
||||
playerl(FacialExpression.HAPPY, "I have everything you need.")
|
||||
stage++
|
||||
} else {
|
||||
playerl(FacialExpression.HALF_GUILTY, "Sorry, I don't have them all yet.")
|
||||
stage = 50
|
||||
}
|
||||
}
|
||||
2 -> npcl("Many thanks. Pass them here, please. I can spare you some coins for your trouble, and please use my anvils any time you want.").also { stage++ }
|
||||
3 -> {
|
||||
if(removeItem(player, Item(Items.CLAY_434, 6)) && removeItem(player, Item(Items.COPPER_ORE_436, 4)) && removeItem(player, Item(Items.IRON_ORE_440, 2))) {
|
||||
sendItemDialogue(player, Items.COPPER_ORE_436, "You hand the clay, copper, and iron to Doric.")
|
||||
finishQuest(player, "Doric's Quest")
|
||||
stage = END_DIALOGUE
|
||||
}
|
||||
}
|
||||
50 -> npcl(FacialExpression.OLD_NORMAL, "Not to worry, stick at it. Remember, I need 6 clay, 4 copper ore, and 2 iron ore.").also { stage++ }
|
||||
51 -> showTopics(
|
||||
Topic(FacialExpression.HALF_ASKING, "Where can I find those?", 52),
|
||||
Topic(FacialExpression.HAPPY, "Certainly, I'll be right back.", END_DIALOGUE)
|
||||
)
|
||||
52 -> npcl(FacialExpression.OLD_NORMAL, "You'll be able to find all those ores in the rocks just inside the Dwarven Mine. Head east from here and you'll find the entrance in the side of Ice Mountain.").also { stage = END_DIALOGUE }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package content.region.asgarnia.falador.quest.doricsquest
|
||||
|
||||
import core.api.*
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.quest.Quest
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.plugin.Initializable
|
||||
import org.rs09.consts.Components
|
||||
import org.rs09.consts.Items
|
||||
|
||||
@Initializable
|
||||
class DoricsQuest : Quest("Doric's Quest", 17, 16, 1, 31, 0, 1, 100) {
|
||||
override fun newInstance(`object`: Any?): Quest { return this }
|
||||
|
||||
override fun drawJournal(player: Player?, stage: Int) {
|
||||
super.drawJournal(player, stage)
|
||||
player ?: return
|
||||
var line = 11
|
||||
if(stage == 0) {
|
||||
line(player, "I can start this quest by speaking to !!Doric?? who is !!North of??", line++)
|
||||
line(player, "!!Falador??.", line++)
|
||||
line(player, "There aren't any requirements but !!Level 15 Mining?? will help.", line++)
|
||||
} else {
|
||||
if(stage == 50) {
|
||||
line(player, "I have spoken to !!Doric??.", line++)
|
||||
line(player, "I need to collect some items and bring them to !!Doric??:", line++)
|
||||
line(player, "6 Clay", line++, inInventory(player, Items.CLAY_434, 6))
|
||||
line(player, "4 Copper Ore", line++, inInventory(player, Items.COPPER_ORE_436, 4))
|
||||
line(player, "2 Iron Ore", line++, inInventory(player, Items.IRON_ORE_440, 2))
|
||||
}
|
||||
|
||||
if(stage == 100) {
|
||||
line(player, "I have spoken to !!Doric??.", line++, true)
|
||||
line(player, "I have collected some Clay, Copper Ore, and Iron Ore.", line++, true)
|
||||
line(player, "Doric rewarded me for all my hard work.", line++, true)
|
||||
line(player, "I can now use Doric's Anvils whenever I want.", line++, true)
|
||||
line++
|
||||
line(player, "%%QUEST COMPLETE!&&", line++)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun finish(player: Player?) {
|
||||
super.finish(player)
|
||||
player ?: return
|
||||
var line = 10
|
||||
|
||||
sendItemZoomOnInterface(player, Components.QUEST_COMPLETE_SCROLL_277, 5, Items.STEEL_PICKAXE_1269)
|
||||
drawReward(player, "1 Quest Point", line++)
|
||||
drawReward(player, "1300 Mining XP", line++)
|
||||
drawReward(player, "180 Coins", line++)
|
||||
drawReward(player, "Use of Doric's Anvils", line++)
|
||||
|
||||
rewardXP(player, Skills.MINING, 1300.0)
|
||||
addItemOrDrop(player, Items.COINS_995, 180)
|
||||
removeAttribute(player, "doric-angy-count")
|
||||
}
|
||||
}
|
||||
|
|
@ -1760,6 +1760,17 @@ fun isQuestComplete(player: Player, quest: String): Boolean {
|
|||
return player.questRepository.getStage(quest) == 100
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the quest for a player.
|
||||
* @param player The player to get the quest for.
|
||||
* @param quest The quest name string
|
||||
* @return the quest object
|
||||
*/
|
||||
fun getQuest(player: Player, quest: String): Quest {
|
||||
return player.questRepository.getQuest(quest)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a player meets the requirements to start a quest, and then starts it if they do. Returns success bool
|
||||
*/
|
||||
|
|
@ -1868,7 +1879,7 @@ fun runcs2 (player: Player, scriptId: Int, vararg arguments: Any) {
|
|||
* @param player the player we are openinig the prompt for
|
||||
* @param options the right-click options the items should have
|
||||
* @param keepAlive whether or not the selection prompt should remain open for multiple interactions
|
||||
* @param callback a callback to handle the selection. The parameters passed to the callback are the slot in the inventory of the selected item, and the 0-9 index of the option clicked.
|
||||
* @param callback a callback to handle the selection. The parameters passed to the callback are the slot in the inventory of the selected item, and the 0-9 index of the option clicked.
|
||||
**/
|
||||
@JvmOverloads
|
||||
fun sendItemSelect (player: Player, vararg options: String, keepAlive: Boolean = false, callback: (slot: Int, optionIndex: Int) -> Unit) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue