armark1ng

Untitled

Sep 4th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.94 KB | None | 0 0
  1. package com.rs.game.player.dialogues.impl;
  2.  
  3. import com.rs.game.map.bossInstance.impl.VoragoInstance;
  4. import com.rs.game.player.TimersManager.RecordKey;
  5. import com.rs.game.player.dialogues.Dialogue;
  6.  
  7. public class VoragoFaceD extends Dialogue {
  8.  
  9. private int npcId;
  10. private int STAGE;
  11. private VoragoInstance instance;
  12. private byte END_STAGE = 46;
  13.  
  14. @Override
  15. public void start() {
  16. npcId = (int) this.parameters[0];
  17. STAGE = (int) this.parameters[1];
  18. instance = (VoragoInstance) this.parameters[2];
  19. switch (STAGE) {
  20. case 0:// npc click 1
  21. if (player.getTimersManager().getRecord(RecordKey.VORAGO) != null) {
  22. stage = 1;
  23. sendNPCDialogue(npcId, NORMAL, player.getDisplayName() + " defeats me, and yet returns...");
  24. } else if (player.hasSpokenToVorago()) {
  25. stage = 1;
  26. sendNPCDialogue(npcId, NORMAL, player.getDisplayName() + " returns.");
  27. } else {
  28. stage = -1;
  29. sendNPCDialogue(npcId, NORMAL, "Hello stranger");
  30. }
  31. break;
  32. case 1:// npc click 2
  33. if (!player.hasSpokenToVorago()) {
  34. stage = END_STAGE;
  35. sendNPCDialogue(npcId, NORMAL,
  36. "So impatient you surfacers are. Speak to me first, for to engage in battle with me ill-prepared could mean your death.");
  37. return;
  38. } else if (instance.ChallengeStarted()) {
  39. if (instance.getAcceptedChallenge().contains(player)) {
  40. stage = END_STAGE;
  41. sendDialogue("You already accepted vorago challenge.");
  42. return;
  43. }
  44. stage = 43;
  45. sendOptionsDialogue("LOOKS LIKE THERE IS A TEST ONGOING TO DO YOU WANT TO JOIN?", "We fight.",
  46. "Not right now.");
  47. } else {
  48. stage = 42;
  49. sendNPCDialogue(npcId, NORMAL, "So, do we fight?");
  50. break;
  51. }
  52. break;
  53. }
  54.  
  55. }
  56.  
  57. @Override
  58. public void run(int interfaceId, int componentId) {
  59. switch (stage) {
  60. case -1:
  61. stage = 0;
  62. player.setSpokenToVorago(true);
  63. sendPlayerDialogue(ANGERY, "I'm no stranger. Call me " + player.getDisplayName() + ".");
  64. break;
  65. case 0:
  66. stage = 1;
  67. sendNPCDialogue(npcId, NORMAL, "So be it, " + player.getDisplayName()
  68. + ". I am the Immoveable. The Enduring. You may call me Vorago.");
  69. break;
  70. case 1:
  71. stage = 2;
  72. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "What are you?", "What are you doing here?",
  73. "I don't want to talk to you.");
  74. break;
  75. case 2:
  76. switch (componentId) {
  77. case OPTION_1:// what are you?
  78. stage = 3;
  79. sendPlayerDialogue(CONFUSED, "What are you?");
  80. break;
  81. case OPTION_2:
  82. stage = 26;
  83. sendPlayerDialogue(CONFUSED, "What are you doing here?");
  84. break;
  85. case OPTION_3:
  86. stage = 45;
  87. sendPlayerDialogue(NORMAL, "I don't want to talk to you.");
  88. break;
  89. }
  90. break;
  91. case 3:
  92. stage = 4;
  93. sendNPCDialogue(npcId, NORMAL,
  94. "I know only that I am of the earth, and the earth and I are one. More than those above see and know. I am here to ensure the continuation of that life.");
  95. break;
  96. case 4:
  97. stage = 5;
  98. sendPlayerDialogue(NORMAL,
  99. "I've heard of living rock creatures, not far from here. Are you of the same kind?");
  100. break;
  101. case 5:
  102. stage = 6;
  103. sendNPCDialogue(npcId, NORMAL,
  104. "They are known to me. I am not as they are, however. The earth soul and I are as one, and they are my wards.");
  105. break;
  106. case 6:
  107. stage = 7;
  108. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "You talk like you don't know what you are.",
  109. "So where did you come from?", "Do you know much about gods?");
  110. break;
  111. case 7:
  112. switch (componentId) {
  113. case OPTION_1:
  114. stage = 8;
  115. sendPlayerDialogue(NORMAL, "You talk like you don't know what you are.");
  116. break;
  117. case OPTION_2:
  118. stage = 14;
  119. sendPlayerDialogue(NORMAL, "So where did you come from?");
  120. break;
  121. case OPTION_3:
  122. stage = 20;
  123. sendPlayerDialogue(NORMAL, "Do you know much about gods?");
  124. break;
  125. }
  126. break;
  127. case 8:
  128. stage = 9;
  129. sendNPCDialogue(npcId, NORMAL,
  130. "It is hard to describe in words that you will understand. I am one with the earth soul. It permeates me, and grants me the power to command the earth.");
  131. break;
  132. case 9:
  133. stage = 10;
  134. sendPlayerDialogue(NORMAL, "Command it? What do you mean by that?");
  135. break;
  136. case 10:
  137. stage = 11;
  138. sendNPCDialogue(npcId, NORMAL,
  139. "I feel the fury of the battles that have taken place on this good earth. I can command it to take shape and fight back, if necessary.");
  140. break;
  141. case 11:
  142. stage = 12;
  143. sendPlayerDialogue(NORMAL, "You could fight?");
  144. break;
  145. case 12:
  146. stage = 13;
  147. sendNPCDialogue(npcId, NORMAL,
  148. "Should I deem it necessary. Should something be of significant enough worth to warrant it, yes.");
  149. break;
  150. case 13:
  151. stage = 2;
  152. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "What are you?", "What are you doing here?",
  153. "I don't want to talk to you.");
  154. break;
  155. case 14:
  156. stage = 15;
  157. sendNPCDialogue(npcId, NORMAL,
  158. "That is an unknown. I feel reawakened of late, as if the world has changed.");
  159. break;
  160. case 15:
  161. stage = 16;
  162. sendPlayerDialogue(NORMAL,
  163. "A lot has changed recently for us all. Do you remember anything before this reawakening?");
  164. break;
  165. case 16:
  166. stage = 17;
  167. sendNPCDialogue(npcId, NORMAL,
  168. "I remember taking shape at one point in my past, using the power of the earth to destroy. I was defeated by a powerful weapon.");
  169. break;
  170. case 17:
  171. stage = 18;
  172. sendPlayerDialogue(NORMAL, "Interesting. Where would that weapon be now?");
  173. break;
  174. case 18:
  175. stage = 19;
  176. sendNPCDialogue(npcId, NORMAL,
  177. "I have it. I may be stopped but not destroyed, I will simply reform in new earth once more. Besides, I hold the only weapon ever to defeat me within my rock itself.");
  178. break;
  179. case 19:
  180. stage = 2;
  181. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "What are you?", "What are you doing here?",
  182. "I don't want to talk to you.");
  183. break;
  184. case 20:
  185. stage = 21;
  186. sendNPCDialogue(npcId, NORMAL, "They are known to me, yes.");
  187. break;
  188. case 21:
  189. stage = 22;
  190. sendPlayerDialogue(NORMAL, "Are you aligned to any?");
  191. break;
  192. case 22:
  193. stage = 23;
  194. sendNPCDialogue(npcId, NORMAL,
  195. "No. Their concerns are not mine. I seek only to defend the deep earth, and to repel those who would do it harm.");
  196. break;
  197. case 23:
  198. stage = 24;
  199. sendPlayerDialogue(NORMAL, "You'd fight them?");
  200. break;
  201. case 24:
  202. stage = 25;
  203. sendNPCDialogue(npcId, NORMAL,
  204. "I seek worthy opponents against which to test myself, to increase my strength and skill. If a god were to approach with such a purpose, it would no doubt be a worthy battle. If they came as conquerors or destroyers, though, then I would need to be prepared.");
  205. break;
  206. case 25:
  207. stage = 2;
  208. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "What are you?", "What are you doing here?",
  209. "I don't want to talk to you.");
  210. break;
  211. case 26:
  212. stage = 27;
  213. sendNPCDialogue(npcId, NORMAL, "I am waiting.");
  214. break;
  215. case 27:
  216. stage = 28;
  217. sendPlayerDialogue(NORMAL, "Waiting for what?");
  218. break;
  219. case 28:
  220. stage = 29;
  221. sendNPCDialogue(npcId, NORMAL, "Those worthy of facing me in battle.");
  222. break;
  223. case 29:
  224. stage = 30;
  225. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "Worthy of facing you?", "Can I face you?");
  226. break;
  227. case 30:
  228. switch (componentId) {
  229. case OPTION_1:
  230. stage = 31;
  231. sendPlayerDialogue(NORMAL, "Worthy of facing you?");
  232. break;
  233. case OPTION_2:
  234. stage = 35;
  235. sendPlayerDialogue(NORMAL, "Can I face you?");
  236. break;
  237. }
  238. break;
  239. case 31:
  240. stage = 32;
  241. sendNPCDialogue(npcId, NORMAL,
  242. "Yes. I must do battle with the strongest ones of this world, to defend against what is to come.");
  243. break;
  244. case 32:
  245. stage = 33;
  246. sendPlayerDialogue(NORMAL, "Who are the unworthy, then?");
  247. break;
  248. case 33:
  249. stage = 34;
  250. if (player.getTimersManager().getRecord(RecordKey.VORAGO) == null)
  251. sendNPCDialogue(npcId, NORMAL,
  252. "To prepare for what is to come, I must fight at the peak of my strength. Those who cannot stand before my power are not worthy. To fight me would be a waste of their lives and of time.");
  253. else
  254. sendNPCDialogue(npcId, NORMAL, "You have defeated me in the past. Consider yourself worthy.");
  255. break;
  256. case 34:
  257. stage = 2;
  258. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "What are you?", "What are you doing here?",
  259. "I don't want to talk to you.");
  260. break;
  261. case 35:
  262. stage = 36;
  263. sendNPCDialogue(npcId, NORMAL,
  264. "I offer a fair test to those who wish to challenge me - a test of resilience and resolve.");
  265. break;
  266. case 36:
  267. stage = 37;
  268. sendPlayerDialogue(NORMAL, "I'm listening.");
  269. break;
  270. case 37:
  271. stage = 38;
  272. sendNPCDialogue(npcId, NORMAL,
  273. "If you or a group of your allies can withstand my raw power, I will face you in combat inside the borehole below.");
  274. break;
  275. case 38:
  276. stage = 39;
  277. sendPlayerDialogue(NORMAL, "When you say 'raw power', how much are we talking about here?");
  278. break;
  279. case 39:
  280. stage = 40;
  281. sendNPCDialogue(npcId, NORMAL,
  282. "I won't hold back. Ensure anyone you bring with you has spoken to me about this as well before I take them with us into the borehole.");
  283. break;
  284. case 40:
  285. stage = 41;
  286. sendDialogue(
  287. "<col=ff0000>Challenging Vorago will initiate an attack</col>. After 20 seconds he will unleash 50,000 damage across yourself and those who choose to accept and go with you into the borehole. Only players who have also spoken to Vorago this far will be offered the option to join a fight if you initiate a challenge.");
  288. break;
  289. case 41:
  290. stage = 42;
  291. sendNPCDialogue(npcId, NORMAL, "So, do we fight?");
  292. break;
  293. case 42:
  294. if (instance.ChallengeStarted()) {
  295. if (instance.getAcceptedChallenge().contains(player)) {
  296. stage = END_STAGE;
  297. sendDialogue("You already accepted vorago challenge.");
  298. return;
  299. }
  300. stage = 43;
  301. sendOptionsDialogue("LOOKS LIKE THERE IS A TEST ONGOING TO DO YOU WANT TO JOIN?", "We fight.",
  302. "Not right now.");
  303. } else {
  304. stage = 43;
  305. sendOptionsDialogue(DEFAULT_OPTIONS_TITLE, "We fight.", "Not right now.");
  306. }
  307. break;
  308. case 43:
  309. switch (componentId) {
  310. case OPTION_1:
  311. stage = END_STAGE;
  312. sendPlayerDialogue(NORMAL, "We fight.");
  313. if (instance.ChallengeStarted()) {
  314. instance.getAcceptedChallenge().add(player);
  315. player.getPackets().sendGameMessage(
  316. "<col=EE7600>Vorago accepted your challenge and begins to charge a massive attack.");
  317. } else {
  318. instance.sendChallenge(player);
  319. }
  320. break;
  321. case OPTION_2:
  322. stage = 44;
  323. sendPlayerDialogue(NORMAL, "Not right now.");
  324. break;
  325. }
  326. break;
  327. case 44:
  328. stage = END_STAGE;
  329. sendNPCDialogue(npcId, NORMAL, "A wise decision, " + player.getDisplayName() + ".");
  330. break;
  331. case 45:
  332. stage = END_STAGE;
  333. sendNPCDialogue(npcId, NORMAL, "It is wise of you to leave. Farewell.");
  334. break;
  335. case 46:
  336. end();
  337. break;
  338. }
  339. }
  340.  
  341. @Override
  342. public void finish() {
  343. // TODO Auto-generated method stub
  344.  
  345. }
  346.  
  347. }
Advertisement
Add Comment
Please, Sign In to add comment