mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Refactored some dialogues in the Ardougne area
Remapped Kortan's shop Fixed stock of Aemad's shop
This commit is contained in:
parent
b640ab7373
commit
ae0b384e44
11 changed files with 259 additions and 376 deletions
|
|
@ -45,22 +45,13 @@
|
||||||
"stock": "{1931,30,100}-{1935,30,100}-{1735,10,100}-{1925,10,100}-{1923,10,100}-{1887,10,100}-{590,10,100}-{1755,10,100}-{2347,10,100}-{550,10,100}-{9003,10,100}"
|
"stock": "{1931,30,100}-{1935,30,100}-{1735,10,100}-{1925,10,100}-{1923,10,100}-{1887,10,100}-{590,10,100}-{1755,10,100}-{2347,10,100}-{550,10,100}-{9003,10,100}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"npcs": "590",
|
"npcs": "590,591",
|
||||||
"high_alch": "0",
|
"high_alch": "0",
|
||||||
"currency": "995",
|
"currency": "995",
|
||||||
"general_store": "true",
|
"general_store": "true",
|
||||||
"id": "6",
|
"id": "6",
|
||||||
"title": "Aemad's Adventuring Supplies Store",
|
"title": "Aemad's Adventuring Supplies",
|
||||||
"stock": "{227,300,100}-{1265,10,100}-{1349,10,100}-{2142,10,100}-{590,10,100}-{1759,100,100}-{882,1000,100}-{954,10,100}-{970,10,100}-{946,10,100}-{1935,10,100}"
|
"stock": "{227,10,100}-{1265,10,100}-{1349,10,100}-{2142,10,100}-{590,10,100}-{1759,100,100}-{882,1000,100}-{954,10,100}-{970,10,100}-{946,10,100}-{1935,10,100}"
|
||||||
},
|
|
||||||
{
|
|
||||||
"npcs": "591",
|
|
||||||
"high_alch": "0",
|
|
||||||
"currency": "995",
|
|
||||||
"general_store": "true",
|
|
||||||
"id": "7",
|
|
||||||
"title": "Kortan General Store",
|
|
||||||
"stock": "{1931,30,100}-{1935,30,100}-{1735,10,100}-{1925,10,100}-{1923,10,100}-{1887,10,100}-{590,10,100}-{1755,10,100}-{2347,10,100}-{550,10,100}-{9003,10,100}"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"npcs": "971",
|
"npcs": "971",
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
package content.global.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 plugin used for the fur trader.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class FurTradePlugin extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code FurTradePlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public FurTradePlugin() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code FurTradePlugin} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public FurTradePlugin(Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new FurTradePlugin(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC) args[0];
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Would you like to trade in fur?");
|
|
||||||
stage = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
interpreter.sendOptions("Select an Option", "Yes.", "No.");
|
|
||||||
stage = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
switch (buttonId) {
|
|
||||||
case 1:
|
|
||||||
end();
|
|
||||||
npc.openShop(player);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, thanks.");
|
|
||||||
stage = 20;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 573 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
package content.global.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;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles the generic shop keeper dialogue.
|
|
||||||
* @author Vexia
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class
|
|
||||||
ShopkeeperDialogue extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code ShopkeeperDialogue} {@code Object}.
|
|
||||||
*/
|
|
||||||
public ShopkeeperDialogue() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code ShopkeeperDialogue} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public ShopkeeperDialogue(Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new ShopkeeperDialogue(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC) args[0];
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Can I help you at all?");
|
|
||||||
stage = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
interpreter.sendOptions("Select an Option", "Yes, please. What are you selling?", "No, thanks.");
|
|
||||||
stage = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
switch (buttonId) {
|
|
||||||
case 1:
|
|
||||||
player("Yes, please. I'd like to see your stock.");
|
|
||||||
stage = 11;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
player("No thanks, I must be going now.");
|
|
||||||
stage = 10;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
end();
|
|
||||||
npc.openShop(player);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 555 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
package content.region.kandarin.ardougne.dialogue;
|
|
||||||
|
|
||||||
import core.game.dialogue.DialoguePlugin;
|
|
||||||
import core.game.node.entity.npc.NPC;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Replacement for ArdougneBaker.asc
|
|
||||||
* @author ceik
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Initializable
|
|
||||||
public class ArdougneBaker extends DialoguePlugin {
|
|
||||||
public ArdougneBaker(){
|
|
||||||
/**
|
|
||||||
* Empty on purpose
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
public ArdougneBaker(Player player){super(player);}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player){return new ArdougneBaker(player);}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC)args[0];
|
|
||||||
npc("Good day, monsieur. Would you like ze nice", "freshly-baked bread? Or perhaps a nice piece of cake?");
|
|
||||||
stage = 1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public final boolean handle(int interfaceId, int buttonId){
|
|
||||||
switch(stage){
|
|
||||||
case 1:
|
|
||||||
interpreter.sendOptions("Choose an option.", "Let's see what you have.", "No thank you.");
|
|
||||||
stage = 2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
switch(buttonId){
|
|
||||||
case 1:
|
|
||||||
end();
|
|
||||||
npc.openShop(player);
|
|
||||||
stage = 20;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 571 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package content.region.kandarin.ardougne.dialogue
|
||||||
|
|
||||||
|
import core.api.openNpcShop
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
@Initializable
|
||||||
|
class ArdougneBakerDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return ArdougneBakerDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun open(vararg args: Any?): Boolean {
|
||||||
|
npc = args[0] as NPC
|
||||||
|
npcl(
|
||||||
|
FacialExpression.HAPPY,
|
||||||
|
"Good day, monsieur. Would you like ze nice freshly-baked bread? Or perhaps a nice piece of cake?"
|
||||||
|
).also { stage = START_DIALOGUE }
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
when (stage) {
|
||||||
|
0 -> options("Let's see what you have.", "No thank you.").also { stage++ }
|
||||||
|
1 -> when (buttonId) {
|
||||||
|
1 -> {
|
||||||
|
openNpcShop(player, NPCs.BAKER_571)
|
||||||
|
end()
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> playerl(
|
||||||
|
FacialExpression.FRIENDLY, "No thank you."
|
||||||
|
).also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.BAKER_571)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
package content.region.kandarin.ardougne.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 dialogue plugin used for the arougne shop keepers.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class ArdougneShopKeeperPlugin extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code ArdouShopKeeperPlugin} {@code Object}.
|
|
||||||
*/
|
|
||||||
public ArdougneShopKeeperPlugin() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code ArdouShopKeeperPlugin} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public ArdougneShopKeeperPlugin(Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new ArdougneShopKeeperPlugin(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC) args[0];
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Hello, you look like a bold adventurer. You've come to the", "right place for adventurers' equipment.");
|
|
||||||
stage = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
interpreter.sendOptions("Select an Option", "Oh, that sounds interesting.", "How should I use your shop?", "No, sorry, I've come to the wrong place.");
|
|
||||||
stage = 1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
switch (buttonId) {
|
|
||||||
case 1:
|
|
||||||
end();
|
|
||||||
npc.openShop(player);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HAPPY, "I'm glad you ask! You can buy as many of the items", "stocked as you wish. You can also sell most items to the", "shop.");
|
|
||||||
stage = 20;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Hmph. Well, perhaps next time you'll need something", "from me?");
|
|
||||||
stage = 30;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 590, 591 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package content.region.kandarin.ardougne.dialogue
|
||||||
|
|
||||||
|
import core.api.openNpcShop
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
@Initializable
|
||||||
|
class FurTraderDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return FurTraderDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun open(vararg args: Any?): Boolean {
|
||||||
|
npc = args[0] as NPC
|
||||||
|
npcl(
|
||||||
|
FacialExpression.ASKING, "Would you like to trade in fur?"
|
||||||
|
).also { stage = START_DIALOGUE }
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
when (stage) {
|
||||||
|
0 -> options("Yes.", "No.").also { stage++ }
|
||||||
|
1 -> when (buttonId) {
|
||||||
|
1 -> {
|
||||||
|
openNpcShop(player, NPCs.FUR_TRADER_573)
|
||||||
|
end()
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> playerl(
|
||||||
|
FacialExpression.HALF_GUILTY, "No, thanks."
|
||||||
|
).also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.FUR_TRADER_573)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
package content.region.kandarin.ardougne.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 gem merchant dialogue plugin.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class GemMerchantDialogue extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code GemMerchantDialogue} {@code Object}.
|
|
||||||
*/
|
|
||||||
public GemMerchantDialogue() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code GemMerchantDialogue} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public GemMerchantDialogue(Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new GemMerchantDialogue(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC) args[0];
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HAPPY, "Here, look at my lovely gems.");
|
|
||||||
stage = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 0:
|
|
||||||
end();
|
|
||||||
npc.openShop(player);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 570 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package content.region.kandarin.ardougne.dialogue
|
||||||
|
|
||||||
|
import core.api.openNpcShop
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
@Initializable
|
||||||
|
class GemMerchantDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return GemMerchantDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun open(vararg args: Any?): Boolean {
|
||||||
|
npc = args[0] as NPC
|
||||||
|
npcl(
|
||||||
|
FacialExpression.HAPPY, "Here, look at my lovely gems."
|
||||||
|
).also { stage = START_DIALOGUE }
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
when (stage) {
|
||||||
|
0 -> {
|
||||||
|
openNpcShop(player, NPCs.GEM_MERCHANT_570)
|
||||||
|
end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.GEM_MERCHANT_570)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,62 @@
|
||||||
|
package content.region.kandarin.ardougne.dialogue
|
||||||
|
|
||||||
|
import content.region.kandarin.dialogue.ShopKeeperDialogue
|
||||||
|
import core.api.openNpcShop
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
@Initializable
|
||||||
|
class ShopKeeperDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return content.region.kandarin.ardougne.dialogue.ShopKeeperDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun open(vararg args: Any?): Boolean {
|
||||||
|
npc = args[0] as NPC
|
||||||
|
npcl(
|
||||||
|
FacialExpression.FRIENDLY,
|
||||||
|
"Hello, you look like a bold adventurer. You've come to the right place for adventurers' equipment."
|
||||||
|
).also { stage = START_DIALOGUE }
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
when (stage) {
|
||||||
|
0 -> options(
|
||||||
|
"Oh, that sounds interesting.",
|
||||||
|
"How should I use your shop?",
|
||||||
|
"No, sorry, I've come to the wrong place."
|
||||||
|
).also { stage++ }
|
||||||
|
|
||||||
|
1 -> when (buttonId) {
|
||||||
|
1 -> {
|
||||||
|
openNpcShop(player, NPCs.AEMAD_590)
|
||||||
|
end()
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> npcl(
|
||||||
|
FacialExpression.HAPPY,
|
||||||
|
"I'm glad you ask! You can buy as many of the items stocked as you wish. You can also sell most items to the shop."
|
||||||
|
).also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
3 -> npcl(
|
||||||
|
FacialExpression.HALF_GUILTY, "Hmph. Well, perhaps next time you'll need something from me?"
|
||||||
|
).also { stage = END_DIALOGUE }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.AEMAD_590, NPCs.KORTAN_591)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package content.region.kandarin.dialogue
|
||||||
|
|
||||||
|
import core.api.openNpcShop
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import core.tools.START_DIALOGUE
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
@Initializable
|
||||||
|
class ShopKeeperDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
override fun newInstance(player: Player?): DialoguePlugin {
|
||||||
|
return ShopKeeperDialogue(player)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun open(vararg args: Any?): Boolean {
|
||||||
|
npc = args[0] as NPC
|
||||||
|
npcl(
|
||||||
|
FacialExpression.HAPPY, "Can I help you at all?"
|
||||||
|
).also { stage = START_DIALOGUE }
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
when (stage) {
|
||||||
|
0 -> options(
|
||||||
|
"Yes, please. I'd like to see your stock.", "No thanks, I must be going now."
|
||||||
|
).also { stage++ }
|
||||||
|
|
||||||
|
1 -> when (buttonId) {
|
||||||
|
1 -> playerl(
|
||||||
|
FacialExpression.FRIENDLY, "Yes, please. I'd like to see your stock."
|
||||||
|
).also { stage++ }
|
||||||
|
|
||||||
|
2 -> playerl(
|
||||||
|
FacialExpression.FRIENDLY, "No thanks, I must be going now."
|
||||||
|
).also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
|
||||||
|
2 -> {
|
||||||
|
openNpcShop(player, NPCs.SHOPKEEPER_555)
|
||||||
|
end()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.SHOPKEEPER_555)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue