Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2011
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.83 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.  
  20. case 1337:
  21. sendOption2("PK'er Scoreboard", "Skiller Scoreboard");
  22. c.dialogueAction = 1337;
  23. break;
  24.  
  25. case 80:
  26. sendStatement("Should I tele you ?");
  27. c.nextChat = 81;
  28. break;
  29.  
  30. case 81:
  31. sendOption2("Yes get me out of this fucking hell hole!", "Hell no! I love it here, I'm nuts for these monkeys!");
  32. c.dialogueAction = 27;
  33. c.nextChat = 0;
  34. break;
  35.  
  36. case 38:
  37. sendStatement("Congratulations, you open the chest and got a reward!");
  38. c.nextChat = 0;
  39. break;
  40.  
  41. case 37:
  42. sendStatement("You need atleast 1 free inventory spaces! and a crystal key!");
  43. c.nextChat = 0;
  44. break;
  45.  
  46.  
  47.  
  48. case 30:
  49. sendNpcChat4("Congratulations!","You have killed 20 monkeys hope you learned something..", "would you like to escape?","Do not break anymore rules!", c.talkingNpc, "Mosol Rei");
  50. c.dialogueAction = 26;
  51. c.nextChat = 31;
  52. break;
  53. case 31:
  54. sendOption2("Yes get me out of this fucking hell hole!", "Hell no! I love it here, I'm nuts for these monkeys!");
  55. c.dialogueAction = 27;
  56. c.nextChat = 0;
  57. break;
  58. case 50:
  59. sendOption2("Ardougne - Multi", "Yanille - 1v1");
  60. c.dialogueAction = 50;
  61. break;
  62. case 51:
  63. sendOption2("Castle Pk (14)", "UnNamed (34)");
  64. c.dialogueAction = 51;
  65. break;
  66. case 32:
  67. sendNpcChat4("You cannot Escape yet!","You've killed "+c.monkeyk0ed+" out of 20 monkeys!","Come back when you have killed 20","Kthxbai", c.talkingNpc, "Mosol Rei");
  68. c.dialogueAction = 30;
  69. c.nextChat = 0;
  70. break;
  71. case 0:
  72. c.talkingNpc = -1;
  73. c.getPA().removeAllWindows();
  74. c.nextChat = 0;
  75. break;
  76. case 20:
  77. sendOption4("Information", "Black Jack","Five", "Maybe later...");
  78. c.dialogueAction = 100;
  79. break;
  80.  
  81. case 25:
  82. sendOption4("","Black Jack", "Five","");
  83. c.dialogueAction = 101;
  84. break;
  85.  
  86. case 21:
  87. sendNpcChat4("The way we play this game is simple. The way you win is",
  88. "You need to get a higher number than me and you win the",
  89. "500,000 coins. You need to bet 250,000 coins per round.",
  90. "If you get over 22 you bust and you lose.",
  91. c.talkingNpc, "~ Black Jack ~");
  92. c.nextChat = 22;
  93. break;
  94.  
  95. case 22:
  96. sendNpcChat4("",
  97. "If i get 22+ I bust and I lose. If you get 21 then you have black",
  98. "jack and you win double of what you bet.",
  99. "",
  100. c.talkingNpc, "~ Black Jack ~");
  101. c.nextChat = 0;
  102. break;
  103.  
  104. case 23:
  105. sendNpcChat4("This is my own game which I made. It's pretty simple",
  106. "and resembles poker but it's a lot different. The aim of this",
  107. "game is to get the same number like the random number",
  108. "You got 2 numbers if both hit the same you win.",
  109. c.talkingNpc, "~ Five ~");
  110. c.nextChat = 24;
  111. break;
  112. case 24:
  113. sendNpcChat4("",
  114. "To play this game you need to bet 1,000,000 coins. You",
  115. "can win a lot of good items but also lose a lot of cash.",
  116. "",
  117. c.talkingNpc, "~ Five ~");
  118. c.nextChat = 0;
  119. break;
  120. case 1:
  121. sendStatement("You found a hidden tunnel! Do you want to enter it?");
  122. c.dialogueAction = 1;
  123. c.nextChat = 2;
  124. break;
  125. case 45:
  126. sendNpcChat2("Since you haven't shown me a defender to", "prove your prowess as a warrior.", 4289, "Kamfreena");
  127. c.nextChat = 46;
  128. break;
  129. case 46:
  130. sendNpcChat3("I'll release some Cyclopes which might drop bronze", "defenders for you to start off with, unless you show me", "another. Have fun in there.", 4289, "Kamfreena");
  131. c.nextChat = -1;
  132. break;
  133. case 47:
  134. sendNpcChat2("The cyclops will now drop:", "" + c.getWarriorsGuild().getCyclopsDrop126(c) + " defenders.", 4289, "Kamfreena");
  135. c.nextChat = -1;
  136. break;
  137. case 2:
  138. sendOption2("Yea! I'm fearless!", "No way! That looks scary!");
  139. c.dialogueAction = 1;
  140. c.nextChat = 0;
  141. break;
  142. case 3:
  143. 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.",
  144. "Would you like a slayer task?", c.talkingNpc, "Duradel");
  145. c.nextChat = 4;
  146. break;
  147. case 5:
  148. sendNpcChat4("Hello adventurer...", "My name is Kolodion, the master of this mage bank.", "Would you like to play a minigame in order ",
  149. "to earn points towards recieving magic related prizes?", c.talkingNpc, "Kolodion");
  150. c.nextChat = 6;
  151. break;
  152. case 6:
  153. sendNpcChat4("The way the game works is as follows...", "You will be teleported to the wilderness,",
  154. "You must kill mages to recieve points,","redeem points with the chamber guardian.", c.talkingNpc, "Kolodion");
  155. c.nextChat = 15;
  156. break;
  157. case 11:
  158. 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.",
  159. "Would you like a slayer task?", c.talkingNpc, "Duradel");
  160. c.nextChat = 12;
  161. break;
  162. case 12:
  163. sendOption2("Yes I would like a slayer task.", "No I would not like a slayer task.");
  164. c.dialogueAction = 5;
  165. break;
  166. case 13:
  167. 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.",
  168. "Would you like me to give you an easier task?", c.talkingNpc, "Duradel");
  169. c.nextChat = 14;
  170. break;
  171. case 14:
  172. sendOption2("Yes I would like an easier task.", "No I would like to keep my task.");
  173. c.dialogueAction = 6;
  174. break;
  175. case 15:
  176. sendOption2("Yes I would like to play", "No, sounds too dangerous for me.");
  177. c.dialogueAction = 7;
  178. break;
  179. case 16:
  180. sendOption2("I would like to reset my barrows brothers.", "I would like to fix all my barrows");
  181. c.dialogueAction = 8;
  182. break;
  183. case 17:
  184. sendOption5("Air", "Mind", "Water", "Earth", "More");
  185. c.dialogueAction = 10;
  186. c.dialogueId = 17;
  187. c.teleAction = -1;
  188. break;
  189. case 18:
  190. sendOption5("Fire", "Body", "Cosmic", "Astral", "More");
  191. c.dialogueAction = 11;
  192. c.dialogueId = 18;
  193. c.teleAction = -1;
  194. break;
  195. case 19:
  196. sendOption5("Nature", "Law", "Death", "Blood", "More");
  197. c.dialogueAction = 12;
  198. c.dialogueId = 19;
  199. c.teleAction = -1;
  200. break;
  201. case 70:
  202. sendNpcChat4("I have found two secret tunnels!", "I saw a giant mole and a Kalphite Queen!", "Help me defeating them?",
  203. "Would you like me, to bring you there?", c.talkingNpc, "Bonafido");
  204. c.nextChat = 71;
  205. break;
  206. case 71:
  207. sendOption2("Giant Mole", "Kalphite Queen");
  208. c.dialogueAction = 13;
  209. c.dialogueId = 71;
  210. c.teleAction = -1;
  211. break;
  212. }
  213. case 40:
  214. sendNpcChat4("Hello ("+c.playername+")", "My name is The Magic Instuctor, and i can teach you the secret of gambling.", "All you need to have is this Dice",
  215. "I can sell you one but you need to follow these rules!", c.talkingNpc, "Magic Instructor");
  216. c.nextChat = 41;
  217. break;
  218. case 41:
  219. sendNpcChat4("While using this Dice", "you may not scam people.", "When the Members of the Staff notice you scam",
  220. "they will permanently ban you'r account.", c.talkingNpc, "Magic Instructor");
  221. c.nextChat = 42;
  222. break;
  223. case 42:
  224. sendNpcChat4("Using this Dice is very simple", "people will give you some money and when they roll", "for example 55 you need to double the money and give it back.",
  225. "Ofcourse you can change the number that needs to be rolled", "to any number that you would like!", c.talkingNpc, "Magic Instructor");
  226. c.nextChat = 42;
  227. break;
  228. case 43:
  229. sendOption2("I would like to buy a Dice!(5 Million GP)", "No i do not want a Dice.");
  230. c.dialogueAction = 23;
  231. c.nextChat = 0;
  232. break;
  233. }
  234.  
  235. /*
  236. * Information Box
  237. */
  238. /*
  239. * Information Box
  240. */
  241.  
  242. public void sendStartInfo(String text, String text1, String text2, String text3, String title) {
  243. c.getPA().sendFrame126(title, 6180);
  244. c.getPA().sendFrame126(text, 6181);
  245. c.getPA().sendFrame126(text1, 6182);
  246. c.getPA().sendFrame126(text2, 6183);
  247. c.getPA().sendFrame126(text3, 6184);
  248. c.getPA().sendFrame164(6179);
  249. }
  250.  
  251. /*
  252. * Options
  253. */
  254.  
  255. private void sendOption(String s, String s1) {
  256. c.getPA().sendFrame126("Select an Option", 2470);
  257. c.getPA().sendFrame126(s, 2471);
  258. c.getPA().sendFrame126(s1, 2472);
  259. c.getPA().sendFrame126("Click here to continue", 2473);
  260. c.getPA().sendFrame164(13758);
  261. }
  262.  
  263. private void sendOption2(String s, String s1) {
  264. c.getPA().sendFrame126("Select an Option", 2460);
  265. c.getPA().sendFrame126(s, 2461);
  266. c.getPA().sendFrame126(s1, 2462);
  267. c.getPA().sendFrame164(2459);
  268. }
  269.  
  270. private void sendOption3(String s, String s1, String s2) {
  271. c.getPA().sendFrame126("Select an Option", 2460);
  272. c.getPA().sendFrame126(s, 2461);
  273. c.getPA().sendFrame126(s1, 2462);
  274. c.getPA().sendFrame126(s2, 2462);
  275. c.getPA().sendFrame164(2459);
  276. }
  277.  
  278. public void sendOption4(String s, String s1, String s2, String s3) {
  279. c.getPA().sendFrame126("Select an Option", 2481);
  280. c.getPA().sendFrame126(s, 2482);
  281. c.getPA().sendFrame126(s1, 2483);
  282. c.getPA().sendFrame126(s2, 2484);
  283. c.getPA().sendFrame126(s3, 2485);
  284. c.getPA().sendFrame164(2480);
  285. }
  286.  
  287. public void sendOption5(String s, String s1, String s2, String s3, String s4) {
  288. c.getPA().sendFrame126("Select an Option", 2493);
  289. c.getPA().sendFrame126(s, 2494);
  290. c.getPA().sendFrame126(s1, 2495);
  291. c.getPA().sendFrame126(s2, 2496);
  292. c.getPA().sendFrame126(s3, 2497);
  293. c.getPA().sendFrame126(s4, 2498);
  294. c.getPA().sendFrame164(2492);
  295. }
  296.  
  297. /*
  298. * Statements
  299. */
  300.  
  301. private void sendStatement(String s) { // 1 line click here to continue chat box interface
  302. c.getPA().sendFrame126(s, 357);
  303. c.getPA().sendFrame126("Click here to continue", 358);
  304. c.getPA().sendFrame164(356);
  305. }
  306.  
  307. /*
  308. * Npc Chatting
  309. */
  310.  
  311. private void sendNpcChat1(String s) {
  312.  
  313. }
  314.  
  315. private 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 Chating 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. public void sendNpcChat2(String s, String s1, int ChatNpc, String name) {
  348. c.getPA().sendFrame200(4888, 591);
  349. c.getPA().sendFrame126(name, 4889);
  350. c.getPA().sendFrame126(s, 4890);
  351. c.getPA().sendFrame126(s1, 4891);
  352. c.getPA().sendFrame75(ChatNpc, 4888);
  353. c.getPA().sendFrame164(4887);
  354. }
  355.  
  356. public void sendNpcChat3(String s, String s1, String s2, int ChatNpc, String name) {
  357. c.getPA().sendFrame200(4894, 591);
  358. c.getPA().sendFrame126(name, 4895);
  359. c.getPA().sendFrame126(s, 4896);
  360. c.getPA().sendFrame126(s1, 4897);
  361. c.getPA().sendFrame126(s2, 4898);
  362. c.getPA().sendFrame75(ChatNpc, 4894);
  363. c.getPA().sendFrame164(4893);
  364. }
  365.  
  366. private void sendPlayerChat3(String s, String s1, String s2) {
  367. c.getPA().sendFrame200(980, 591);
  368. c.getPA().sendFrame126(c.playerName, 981);
  369. c.getPA().sendFrame126(s, 982);
  370. c.getPA().sendFrame126(s1, 983);
  371. c.getPA().sendFrame126(s2, 984);
  372. c.getPA().sendFrame185(980);
  373. c.getPA().sendFrame164(979);
  374. }
  375.  
  376. public void talk(int face, String line1, String line2, String line3, String line4, int npcID) {
  377. c.getPA().sendFrame200(4901, face);
  378. c.getPA().sendFrame126(c.getPA().GetNpcName(npcID).replaceAll("_", " "), 4902);
  379. c.getPA().sendFrame126(""+line1, 4903);
  380. c.getPA().sendFrame126(""+line2, 4904);
  381. c.getPA().sendFrame126(""+line3, 4905);
  382. c.getPA().sendFrame126(""+line4, 4906);
  383. c.getPA().sendFrame126("Click here to continue", 4907);
  384. c.getPA().sendFrame75(npcID, 4901);
  385. c.getPA().sendFrame164(4900);
  386. }
  387.  
  388. private void sendPlayerChat4(String s, String s1, String s2, String s3) {
  389. c.getPA().sendFrame200(987, 591);
  390. c.getPA().sendFrame126(c.playerName, 988);
  391. c.getPA().sendFrame126(s, 989);
  392. c.getPA().sendFrame126(s1, 990);
  393. c.getPA().sendFrame126(s2, 991);
  394. c.getPA().sendFrame126(s3, 992);
  395. c.getPA().sendFrame185(987);
  396. c.getPA().sendFrame164(986);
  397. }
  398. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement