Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.rs.game.player.dialogues;
- import com.rs.cache.loaders.NPCDefinitions;
- import com.rs.game.ForceTalk;
- import com.rs.game.player.Skills;
- import com.rs.utils.ShopsHandler;
- public class TestDialogue extends Dialogue {
- private int npcId;
- @Override
- public void start() {
- npcId = (int) parameters[0];
- switch(npcId) {
- case 14877:
- sendEntityDialogue(
- SEND_1_TEXT_CHAT,
- new String[] {
- NPCDefinitions.getNPCDefinitions(npcId).name,
- "You would be suprised how many people use crafted goods in Burthrope" },
- IS_NPC, npcId, 9827);
- break;
- case 14870:
- sendEntityDialogue(
- SEND_1_TEXT_CHAT,
- new String[] {
- NPCDefinitions.getNPCDefinitions(npcId).name,
- "" + NPCDefinitions.getNPCDefinitions(npcId).name + " at your service."},
- IS_NPC, npcId, 9827);
- break;
- case 14864:
- sendEntityDialogue(
- SEND_1_TEXT_CHAT,
- new String[] {
- NPCDefinitions.getNPCDefinitions(npcId).name,
- "I walk the line between predator and prey, and provide food for the Imperial Guard at the same time. Come! Join me on the hunt." },
- IS_NPC, npcId, 9827);
- break;
- }
- }
- @Override
- public void run(int interfaceId, int componentId) {
- switch(npcId) {
- case 14877:
- if (stage == -1) {
- sendOptionsDialogue("What would you like to say?",
- "I need Crafting supplies",
- "I need you to tan hides for me",
- "What " + getSkillName() + " recommendations do you have for me?",
- "None");
- }
- if (componentId == OPTION_1) {
- ShopsHandler.openShop(player, 145);
- end();
- } else if (componentId == OPTION_2) {
- player.getDialogueManager().startDialogue("TanningD");
- } else if (componentId == OPTION_3) {
- // handle recommendations screen
- end();
- } else if (componentId == OPTION_4) {
- end();
- }
- break;
- case 14864:
- if (stage == -1) {
- sendOptionsDialogue("What would you like to say?",
- "I need " + getSkillName() + " supplies",
- "Tell me more about " + getSkillName() +"",
- "I want to train " + getSkillName() + "",
- "None");
- }
- if (componentId == OPTION_1) {
- ShopsHandler.openShop(player, 143);
- end();
- } else if (componentId == OPTION_2) {
- sendEntityDialogue(
- SEND_1_TEXT_CHAT,
- new String[] {
- NPCDefinitions.getNPCDefinitions(npcId).name,
- "'Hunter' is only a word. What matters is you versus nature. Man versus beast! Feel the thrill of the predator!" },
- IS_NPC, npcId, 9827);
- stage = 1;
- } else if (componentId == OPTION_3) {
- // handle recommendations screen
- end();
- } else if (componentId == OPTION_4) {
- end();
- }
- if (stage == 1) {
- if (componentId == CONTINUE_OPTION) {
- sendEntityDialogue(
- SEND_2_TEXT_CHAT,
- new String[] {
- NPCDefinitions.getNPCDefinitions(npcId).name,
- "As if it weren't enough, could you imagine a better source of food and reagents?" },
- IS_NPC, npcId, 9827);
- }
- }
- break;
- case 14870:
- if (stage == -1) {
- sendOptionsDialogue("What would you like to say?",
- "I need Mining supplies",
- "What " + getSkillName() + " recommendations do you have for me?",
- "None");
- }
- if (componentId == OPTION_1) {
- ShopsHandler.openShop(player, 149);
- end();
- } else if (componentId == OPTION_2) {
- // hadnle recommendations screen
- end();
- } else if (componentId == OPTION_3) {
- end();
- }
- break;
- }
- }
- public String getSkillName() {
- switch(npcId) {
- case 14877:
- return "Crafting";
- case 14870:
- return "Mining";
- case 14864:
- return "Hunting";
- }
- return null;
- }
- @Override
- public void finish() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement