Advertisement
Guest User

Untitled

a guest
May 30th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.62 KB | None | 0 0
  1. package com.rs.game.player.dialogues;
  2.  
  3. import com.rs.cache.loaders.NPCDefinitions;
  4. import com.rs.game.ForceTalk;
  5. import com.rs.game.player.Skills;
  6. import com.rs.utils.ShopsHandler;
  7.  
  8. public class TestDialogue extends Dialogue {
  9.  
  10. private int npcId;
  11.  
  12. @Override
  13. public void start() {
  14. npcId = (int) parameters[0];
  15. switch(npcId) {
  16. case 14877:
  17. sendEntityDialogue(
  18. SEND_1_TEXT_CHAT,
  19. new String[] {
  20. NPCDefinitions.getNPCDefinitions(npcId).name,
  21. "You would be suprised how many people use crafted goods in Burthrope" },
  22. IS_NPC, npcId, 9827);
  23. break;
  24. case 14870:
  25. sendEntityDialogue(
  26. SEND_1_TEXT_CHAT,
  27. new String[] {
  28. NPCDefinitions.getNPCDefinitions(npcId).name,
  29. "" + NPCDefinitions.getNPCDefinitions(npcId).name + " at your service."},
  30. IS_NPC, npcId, 9827);
  31. break;
  32. case 14864:
  33. sendEntityDialogue(
  34. SEND_1_TEXT_CHAT,
  35. new String[] {
  36. NPCDefinitions.getNPCDefinitions(npcId).name,
  37. "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." },
  38. IS_NPC, npcId, 9827);
  39. break;
  40. }
  41. }
  42.  
  43. @Override
  44. public void run(int interfaceId, int componentId) {
  45. switch(npcId) {
  46. case 14877:
  47. if (stage == -1) {
  48. sendOptionsDialogue("What would you like to say?",
  49. "I need Crafting supplies",
  50. "I need you to tan hides for me",
  51. "What " + getSkillName() + " recommendations do you have for me?",
  52. "None");
  53. }
  54. if (componentId == OPTION_1) {
  55. ShopsHandler.openShop(player, 145);
  56. end();
  57. } else if (componentId == OPTION_2) {
  58. player.getDialogueManager().startDialogue("TanningD");
  59. } else if (componentId == OPTION_3) {
  60. // handle recommendations screen
  61. end();
  62. } else if (componentId == OPTION_4) {
  63. end();
  64. }
  65. break;
  66. case 14864:
  67. if (stage == -1) {
  68. sendOptionsDialogue("What would you like to say?",
  69. "I need " + getSkillName() + " supplies",
  70. "Tell me more about " + getSkillName() +"",
  71. "I want to train " + getSkillName() + "",
  72. "None");
  73. }
  74. if (componentId == OPTION_1) {
  75. ShopsHandler.openShop(player, 143);
  76. end();
  77. } else if (componentId == OPTION_2) {
  78. sendEntityDialogue(
  79. SEND_1_TEXT_CHAT,
  80. new String[] {
  81. NPCDefinitions.getNPCDefinitions(npcId).name,
  82. "'Hunter' is only a word. What matters is you versus nature. Man versus beast! Feel the thrill of the predator!" },
  83. IS_NPC, npcId, 9827);
  84. stage = 1;
  85. } else if (componentId == OPTION_3) {
  86. // handle recommendations screen
  87. end();
  88. } else if (componentId == OPTION_4) {
  89. end();
  90. }
  91. if (stage == 1) {
  92. if (componentId == CONTINUE_OPTION) {
  93. sendEntityDialogue(
  94. SEND_2_TEXT_CHAT,
  95. new String[] {
  96. NPCDefinitions.getNPCDefinitions(npcId).name,
  97. "As if it weren't enough, could you imagine a better source of food and reagents?" },
  98. IS_NPC, npcId, 9827);
  99. }
  100. }
  101. break;
  102. case 14870:
  103. if (stage == -1) {
  104. sendOptionsDialogue("What would you like to say?",
  105. "I need Mining supplies",
  106. "What " + getSkillName() + " recommendations do you have for me?",
  107. "None");
  108. }
  109. if (componentId == OPTION_1) {
  110. ShopsHandler.openShop(player, 149);
  111. end();
  112. } else if (componentId == OPTION_2) {
  113. // hadnle recommendations screen
  114. end();
  115. } else if (componentId == OPTION_3) {
  116. end();
  117. }
  118. break;
  119. }
  120. }
  121.  
  122. public String getSkillName() {
  123. switch(npcId) {
  124. case 14877:
  125. return "Crafting";
  126. case 14870:
  127. return "Mining";
  128. case 14864:
  129. return "Hunting";
  130. }
  131. return null;
  132. }
  133.  
  134. @Override
  135. public void finish() {
  136. }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement