Guest User

Untitled

a guest
Jan 21st, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.38 KB | None | 0 0
  1. package server.model.players;
  2.  
  3. public class DialogueHandler {
  4.  
  5. private Client c;
  6.  
  7. public DialogueHandler(Client client) {
  8. this.c = client;
  9. }
  10.  
  11. /**
  12. * Handles all talking
  13. * @param dialogue The dialogue you want to use
  14. * @param npcId The npc id that the chat will focus on during the chat
  15. */
  16. public void sendDialogues(int dialogue, int npcId) {
  17. c.talkingNpc = npcId;
  18. switch(dialogue) {
  19. case 0:
  20. c.talkingNpc = -1;
  21. c.getPA().removeAllWindows();
  22. c.nextChat = 0;
  23. break;
  24. case 7390:
  25. sendOption2("Yes", "No");
  26. c.nextChat = 7391;
  27. break;
  28. /*Arnold*/
  29. case 33:
  30. sendNpcChat4("Hello!", "My names Arnold, pleasure to meet you.", "I'm the treasurer for our little village here", "which means", c.talkingNpc, "Arnold");
  31. c.nextChat = 34;
  32. break;
  33.  
  34. case 34:
  35. sendNpcChat4( "I can either sell you items", "or let you acces your bank account", "which would you like", "to do?", c.talkingNpc, "Arnold");
  36. c.nextChat = 35;
  37. break;
  38. case 35:
  39. c.dialogueAction = 100;
  40. sendOption2("Trade", "Bank");
  41. break;
  42. /*End Arnold*/
  43. /*Ramu*/
  44. case 36:
  45. sendNpcChat4("What do you want?", "I don't even care, I don't have time", "for annoyances like you", "go away!", c.talkingNpc, "Ramaru");
  46. break;
  47. /*End Ramu*/
  48. /*George*/
  49. case 37:
  50. sendPlayerChat1("Hello!");
  51. c.nextChat = 38;
  52. break;
  53. case 38:
  54. sendNpcChat2("Hey there mate!", "What can I do for you?", c.talkingNpc, "George");
  55. c.nextChat = 39;
  56. break;
  57. case 39:
  58. sendPlayerChat1("Nothing really, I just wanted to chat ");
  59. c.nextChat = 40;
  60. break;
  61. case 40:
  62. sendNpcChat2("Right..", "I'm really busy right now, so maybe another time", c.talkingNpc, "George");
  63. break;
  64. /*End George*/
  65. case 1:
  66. sendStatement("You found a hidden tunnel! Do you want to enter it?");
  67. c.dialogueAction = 1;
  68. c.nextChat = 2;
  69. break;
  70. case 2:
  71. sendOption2("Yea! I'm fearless!", "No way! That looks scary!");
  72. c.dialogueAction = 1;
  73. c.nextChat = 0;
  74. break;
  75. case 3:
  76. sendNpcChat4("Hello!", "My name is Duradel and I am a master of the slayer skill.", "I can assign you a slayer task suitable to your combat level.",
  77. "Would you like a slayer task?", c.talkingNpc, "Duradel");
  78. c.nextChat = 4;
  79. break;
  80. case 5:
  81. sendNpcChat4("Hello adventurer...", "My name is Kolodion, the master of this mage bank.", "Would you like to play a minigame in order ",
  82. "to earn points towards recieving magic related prizes?", c.talkingNpc, "Kolodion");
  83. c.nextChat = 6;
  84. break;
  85. case 6:
  86. sendNpcChat4("The way the game works is as follows...", "You will be teleported to the wilderness,",
  87. "You must kill mages to recieve points,","redeem points with the chamber guardian.", c.talkingNpc, "Kolodion");
  88. c.nextChat = 15;
  89. break;
  90. case 11:
  91. sendNpcChat4("Hello!", "My name is Duradel and I am a master of the slayer skill.", "I can assign you a slayer task suitable to your combat level.",
  92. "Would you like a slayer task?", c.talkingNpc, "Duradel");
  93. c.nextChat = 12;
  94. break;
  95. case 12:
  96. sendOption2("Yes I would like a slayer task.", "No I would not like a slayer task.");
  97. c.dialogueAction = 5;
  98. break;
  99. case 13:
  100. sendNpcChat4("Hello!", "My name is Duradel and I am a master of the slayer skill.", "I see I have already assigned you a task to complete.",
  101. "Would you like me to give you an easier task?", c.talkingNpc, "Duradel");
  102. c.nextChat = 14;
  103. break;
  104. case 14:
  105. sendOption2("Yes I would like an easier task.", "No I would like to keep my task.");
  106. c.dialogueAction = 6;
  107. break;
  108. case 15:
  109. sendOption2("Yes I would like to play", "No, sounds too dangerous for me.");
  110. c.dialogueAction = 7;
  111. break;
  112. case 16:
  113. sendOption2("I would like to reset my barrows brothers.", "I would like to fix all my barrows");
  114. c.dialogueAction = 8;
  115. break;
  116. case 17:
  117. sendOption5("Air", "Mind", "Water", "Earth", "More");
  118. c.dialogueAction = 10;
  119. c.dialogueId = 17;
  120. c.teleAction = -1;
  121. break;
  122. case 18:
  123. sendOption5("Fire", "Body", "Cosmic", "Astral", "More");
  124. c.dialogueAction = 11;
  125. c.dialogueId = 18;
  126. c.teleAction = -1;
  127. break;
  128. case 19:
  129. sendOption5("Nature", "Law", "Death", "Blood", "More");
  130. c.dialogueAction = 12;
  131. c.dialogueId = 19;
  132. c.teleAction = -1;
  133. break;
  134. case 20:
  135. sendNpcChat4("Hello there.", "I am one of the shop owners here.", "I can sell you basic survival gear.",
  136. "Would you like to browse through my goods?", c.talkingNpc, "Shop Keeper");
  137. c.nextChat = 21;
  138. break;
  139. case 21:
  140. sendOption2("Yes", "No");
  141. c.getShops().openShop(1);
  142.  
  143. break;
  144. case 22:
  145. sendNpcChat4("Hi there.", "I'm Gerrant, an expert fisher.", "I can sell you any fishing gear you'd need.",
  146. "Would you like to see what I have in store?", c.talkingNpc, "Gerrant");
  147. c.nextChat = 23;
  148. break;
  149. case 23:
  150. sendOption2("Yes", "No");
  151. c.getShops().openShop(2);
  152. break;
  153. case 25:
  154. sendNpcChat4("Hello.", "You look like you could use some food.", "Or maybe some supplies an adventurer like you would need.",
  155. "Would you like to see what I have to offer?", c.talkingNpc, "Shop Assistant");
  156. c.nextChat = 26;
  157. break;
  158. case 26:
  159. sendOption2("Yes", "No");
  160. c.getShops().openShop(3);
  161.  
  162. break;
  163. case 27:
  164. sendNpcChat4("Hi, I'm a gem trader from Al Kharid.", "I'm a skilled crafter with years of experience", "and I have made many amulets from my gems.",
  165. "Would you like to see what I have to offer?", c.talkingNpc, "Gem Trader");
  166. c.nextChat = 28;
  167. break;
  168. case 28:
  169. sendOption2("Yes", "No");
  170. c.getShops().openShop(7);
  171.  
  172. break;
  173. case 29:
  174. sendNpcChat4("Hi there.", "I'm a skilled chief and baker with years of experience", "and I have cooked many things.",
  175. "Would you like to see what I have to offer?", c.talkingNpc, "Baker");
  176. c.nextChat = 30;
  177. break;
  178. case 30:
  179. sendOption2("Yes", "No");
  180. c.getShops().openShop(4);
  181.  
  182. break;
  183. case 31:
  184. sendNpcChat4("Hello", "I sell herblore ingredients", "and vials for good prices.",
  185. "Would you like to see what I have to offer?", c.talkingNpc, "Jatix");
  186. c.nextChat = 30;
  187. break;
  188. case 32:
  189. sendOption2("Yes", "No");
  190. c.getShops().openShop(7);
  191.  
  192. break;
  193.  
  194. case 41://Lumbridge Guide
  195. sendNpcChat4("Hello there good sir, I am the Lumbridge guide", "It's my job to give players such as yourself", "directions and advice. I'm a little busy", "right now tho, can you come back later?", c.talkingNpc, "Lumbridge Guide");
  196. break;
  197.  
  198. case 42:
  199. sendPlayerChat2("Hello there!", "My name is + c.playerName");
  200. c.nextChat = 43;
  201. break;
  202.  
  203. case 43:
  204. sendNpcChat1("Oh, hello there + c.playerName", c.talkingNpc, "Man");
  205. break;
  206.  
  207. case 44:
  208. sendNpcChat2("Oh, hello there lovely.", "I'd love to stay and chat but I have to run, bye!", c.talkingNpc, "Women");
  209. break;
  210.  
  211. case 45:
  212. sendNpcChat4("Hallo there mate!", "The names Bob, and axes are what I love", "Anyfing I can do fer ya?", c.talkingNpc, "Bob");
  213. c.nextChat = 46;
  214. break;
  215.  
  216.  
  217.  
  218.  
  219. }
  220. }
  221.  
  222. /*
  223. * Information Box
  224. */
  225.  
  226. public void sendStartInfo(String text, String text1, String text2, String text3, String title) {
  227. c.getPA().sendFrame126(title, 6180);
  228. c.getPA().sendFrame126(text, 6181);
  229. c.getPA().sendFrame126(text1, 6182);
  230. c.getPA().sendFrame126(text2, 6183);
  231. c.getPA().sendFrame126(text3, 6184);
  232. c.getPA().sendFrame164(6179);
  233. }
  234.  
  235. /*
  236. * Options
  237. */
  238.  
  239. private void sendOption(String s, String s1) {
  240. c.getPA().sendFrame126("Select an Option", 2470);
  241. c.getPA().sendFrame126(s, 2471);
  242. c.getPA().sendFrame126(s1, 2472);
  243. c.getPA().sendFrame126("Click here to continue", 2473);
  244. c.getPA().sendFrame164(13758);
  245. }
  246.  
  247. private void sendOption2(String s, String s1) {
  248. c.getPA().sendFrame126("Select an Option", 2460);
  249. c.getPA().sendFrame126(s, 2461);
  250. c.getPA().sendFrame126(s1, 2462);
  251. c.getPA().sendFrame164(2459);
  252. }
  253.  
  254. private void sendOption3(String s, String s1, String s2) {
  255. c.getPA().sendFrame126("Select an Option", 2460);
  256. c.getPA().sendFrame126(s, 2461);
  257. c.getPA().sendFrame126(s1, 2462);
  258. c.getPA().sendFrame126(s2, 2462);
  259. c.getPA().sendFrame164(2459);
  260. }
  261.  
  262. public void sendOption4(String s, String s1, String s2, String s3) {
  263. c.getPA().sendFrame126("Select an Option", 2481);
  264. c.getPA().sendFrame126(s, 2482);
  265. c.getPA().sendFrame126(s1, 2483);
  266. c.getPA().sendFrame126(s2, 2484);
  267. c.getPA().sendFrame126(s3, 2485);
  268. c.getPA().sendFrame164(2480);
  269. }
  270.  
  271. public void sendOption5(String s, String s1, String s2, String s3, String s4) {
  272. c.getPA().sendFrame126("Select an Option", 2493);
  273. c.getPA().sendFrame126(s, 2494);
  274. c.getPA().sendFrame126(s1, 2495);
  275. c.getPA().sendFrame126(s2, 2496);
  276. c.getPA().sendFrame126(s3, 2497);
  277. c.getPA().sendFrame126(s4, 2498);
  278. c.getPA().sendFrame164(2492);
  279. }
  280.  
  281. /*
  282. * Statements
  283. */
  284.  
  285. public void sendStatement(String s) { // 1 line click here to continue chat box interface
  286. c.getPA().sendFrame126(s, 357);
  287. c.getPA().sendFrame126("Click here to continue", 358);
  288. c.getPA().sendFrame164(356);
  289. }
  290.  
  291. /*
  292. * Npc Chatting
  293. */
  294.  
  295. private void sendNpcChat1(String s) {
  296.  
  297. }
  298. private void sendNpcChat2(String s, String s1, int ChatNpc, String name) {
  299. c.getPA().sendFrame200(4888, 9847);
  300. c.getPA().sendFrame126(name, 4889);
  301. c.getPA().sendFrame126(s, 4890);
  302. c.getPA().sendFrame126(s1, 4891);
  303. c.getPA().sendFrame75(ChatNpc, 4888);
  304. c.getPA().sendFrame164(4887);
  305. }
  306. public void sendNpcChat3(String s, String s1, String s2, int ChatNpc, String name) {
  307. c.getPA().sendFrame200(4894, 9847);
  308. c.getPA().sendFrame126(name, 4895);
  309. c.getPA().sendFrame126(s, 4896);
  310. c.getPA().sendFrame126(s1, 4897);
  311. c.getPA().sendFrame126(s2, 4898);
  312. c.getPA().sendFrame75(ChatNpc, 4894);
  313. c.getPA().sendFrame164(4893);
  314. }
  315. void sendNpcChat4(String s, String s1, String s2, String s3, int ChatNpc, String name) {
  316. c.getPA().sendFrame200(4901, 591);
  317. c.getPA().sendFrame126(name, 4902);
  318. c.getPA().sendFrame126(s, 4903);
  319. c.getPA().sendFrame126(s1, 4904);
  320. c.getPA().sendFrame126(s2, 4905);
  321. c.getPA().sendFrame126(s3, 4906);
  322. c.getPA().sendFrame75(ChatNpc, 4901);
  323. c.getPA().sendFrame164(4900);
  324. }
  325.  
  326. /*
  327. * Player chats Back
  328. */
  329.  
  330. private void sendPlayerChat1(String s) {
  331. c.getPA().sendFrame200(969, 591);
  332. c.getPA().sendFrame126(c.playerName, 970);
  333. c.getPA().sendFrame126(s, 971);
  334. c.getPA().sendFrame185(969);
  335. c.getPA().sendFrame164(968);
  336. }
  337.  
  338. private void sendPlayerChat2(String s, String s1) {
  339. c.getPA().sendFrame200(974, 591);
  340. c.getPA().sendFrame126(c.playerName, 975);
  341. c.getPA().sendFrame126(s, 976);
  342. c.getPA().sendFrame126(s1, 977);
  343. c.getPA().sendFrame185(974);
  344. c.getPA().sendFrame164(973);
  345. }
  346.  
  347. private void sendPlayerChat3(String s, String s1, String s2) {
  348. c.getPA().sendFrame200(980, 591);
  349. c.getPA().sendFrame126(c.playerName, 981);
  350. c.getPA().sendFrame126(s, 982);
  351. c.getPA().sendFrame126(s1, 983);
  352. c.getPA().sendFrame126(s2, 984);
  353. c.getPA().sendFrame185(980);
  354. c.getPA().sendFrame164(979);
  355. }
  356.  
  357. private void sendPlayerChat4(String s, String s1, String s2, String s3) {
  358. c.getPA().sendFrame200(987, 591);
  359. c.getPA().sendFrame126(c.playerName, 988);
  360. c.getPA().sendFrame126(s, 989);
  361. c.getPA().sendFrame126(s1, 990);
  362. c.getPA().sendFrame126(s2, 991);
  363. c.getPA().sendFrame126(s3, 992);
  364. c.getPA().sendFrame185(987);
  365. c.getPA().sendFrame164(986);
  366. }
  367. }
Add Comment
Please, Sign In to add comment