Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.64 KB | None | 0 0
  1. /*
  2. * Temple Keeper
  3. * ID: 2140000
  4. *
  5. * Time Lane | Three Doors
  6. * Quests 12000, 12001, 12002
  7. */
  8.  
  9. /* jshint ignore: start */
  10. /* Array.prototype.findIndex() polyfill */
  11. Array.prototype.findIndex=Array.prototype.findIndex||function(evaluator,thisArg){"use strict";if(!this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof evaluator){if("string"!=typeof evaluator)throw new TypeError;if(!(evaluator=eval(evaluator)))throw new TypeError}var i;if(void 0===thisArg){for(i in this)if(evaluator(this[i],i,this))return i;return-1}for(i in this)if(evaluator.call(thisArg,this[i],i,this))return i;return-1};
  12. /* jshint ignore: end */
  13.  
  14. var status;
  15. var questIds = [12000, 12001, 12002];
  16. var questNums = [6, 7, 8];
  17. var selection1, selection2;
  18.  
  19. function start() {
  20. status = -1;
  21. action(1, 0, 0);
  22. }
  23.  
  24. function action(mode, type, selection) {
  25. var p = cm.getPlayer();
  26. if (p.getLevel() < 90 || (p.getQuestId() !== 0 && questIds.indexOf(p.getQuestId()) === -1)) {
  27. cm.sendOk("#econtinues reading silently as the ancient scroll in his hand slowly, but actively, falls to dust#n");
  28. cm.dispose();
  29. return;
  30. }
  31. if (mode < 0 || (mode === 0 && (type === 4 || status < 1))) {
  32. cm.dispose();
  33. return;
  34. }
  35. status += mode === 1 ? 1 : -1;
  36.  
  37. var questIndex = questNums.findIndex(function(qn) {
  38. return !p.getQuestCompletion(qn);
  39. });
  40.  
  41. switch (questIndex) {
  42. case -1:
  43. cm.sendOk("#econtinues reading silently as the ancient scroll in his hand slowly, but actively, falls to dust#n");
  44. cm.dispose();
  45. return;
  46. case 0:
  47. if (!cm.onQuest()) {
  48. switch (status) {
  49. case 0:
  50. cm.sendSimple(cm.selectQuest(questIds[questIndex], "#econtinues reading silently as the ancient scroll in his hand slowly, but actively, falls to dust#n"));
  51. break;
  52. case 1:
  53. cm.sendSimple(p.getCQuest().getInfo() + "\r\n\r\n#L0#Vaguely?#l\r\n#L1#(walk a bit closer to the old man)#l\r\n#L2#Hah, nope. Not a human. Not even a little. (quickly walk away)#l");
  54. break;
  55. case 2:
  56. selection1 = selection;
  57. switch (selection) {
  58. case 0:
  59. cm.sendSimple("Well, you don't have a nose.\r\n\r\n#L0#Excuse me? I am noseless and proud.#l\r\n#L1#Well, neither do you.#l\r\n#L2#What are you talking abou -- oh. OH SHIT AAAAAAAAAAA I HAVE NO NOSE WHAT THE FUCK AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA#l");
  60. break;
  61. case 1:
  62. cm.sendSimple("#ethe old man doesn't appear to budge or to make any sound#n\r\n\r\n#L0#(walk a bit closer yet)#l\r\n#L1#(retrace your few steps back)#l\r\n#L2#(decide better of this old man and swiftly walk away)#l");
  63. break;
  64. default:
  65. cm.dispose();
  66. return;
  67. }
  68. break;
  69. case 3:
  70. selection2 = selection;
  71. switch (selection1) {
  72. case 0:
  73. switch (selection) {
  74. case 0:
  75. // Excuse me? I am noseless and proud.
  76. cm.sendSimple("#ethe old man adjusts his spectacles once again#n\r\n\r\nAre you sure? Haven't you ever wanted to smell the air? To taste foodstuffs?\r\n\r\n#L0#Well... I guess so, yeah.#l\r\n#L1#No, not really.#l");
  77. break;
  78. case 1:
  79. // Well, neither do you.
  80. cm.sendSimple("#ethe old man's brows furrow#n\r\n\r\nIs that an insult?\r\n\r\n#L0#Well, I mean, no. Like, I don't hate. I don't have one either.#l\r\n#L1#Uhhh... MAYBE.#l");
  81. break;
  82. default:
  83. // What are you talking abou -- oh. OH SHIT AAAAAAAAAAA I HAVE NO NOSE WHAT THE FUCK AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  84. cm.sendOk("#ethe old man nearly fumbles his spectacles and quickly decides to go back to reading#n");
  85. cm.dispose();
  86. return;
  87. }
  88. break;
  89. case 1:
  90. switch (selection) {
  91. case 0:
  92. // (walk a bit closer yet)
  93. cm.sendSimple("#ethe old man's gaze intensifies#n\r\n\r\n#L0#(get away from the gaze)#l\r\n#L1#(stare back at the old man's tiny, beady eyes)#l");
  94. break;
  95. case 1:
  96. // (retrace your few steps back)
  97. cm.sendSimple("#ethe old man's brows furrow#n\r\n\r\n#L0#(keep walking back)#l\r\n#L1#W--What do you want?#l");
  98. break;
  99. default:
  100. // (decide better of this old man and swiftly walk away)
  101. cm.dispose();
  102. return;
  103. }
  104. break;
  105. default:
  106. cm.dispose();
  107. return;
  108. }
  109. break;
  110. case 4:
  111. switch (selection1) {
  112. case 0:
  113. switch (selection2) {
  114. case 0:
  115. switch (selection) {
  116. case 0:
  117. // Well... I guess so, yeah.
  118. cm.sendSimple("Have you ever... wanted to walk down #e#bMemory Lane#k#n?\r\n\r\n#L0#Look, is this some kind of a scam?#l\r\n#L1#What's that?#l");
  119. break;
  120. case 1:
  121. // No, not really.
  122. cm.sendOk("#ethe old man's tiny beady eyes roll#n");
  123. cm.dispose();
  124. return;
  125. }
  126. break;
  127. case 1:
  128. switch (selection) {
  129. case 0:
  130. // Well, I mean, no. Like, I don't hate. I don't have one either.
  131. cm.sendSimple("In any case...\r\n\r\n#ethe old man quickly wipes his mouth-nose area with a gloved hand#n\r\n\r\nHave you, noseless human, considered a walk down #e#bMemory Lane#k#n?\r\n\r\n#L0#Is that some kind of a scam?#l\r\n#L1#What's that?#l");
  132. break;
  133. case 1:
  134. // Uhhh... MAYBE.
  135. cm.sendOk("#ethe old man's tiny beady eyes roll#n");
  136. cm.dispose();
  137. return;
  138. }
  139. break;
  140. default:
  141. cm.dispose();
  142. return;
  143. }
  144. break;
  145. case 1:
  146. switch (selection2) {
  147. case 0:
  148. switch (selection) {
  149. case 0:
  150. // (get away from the gaze)
  151. cm.dispose();
  152. return;
  153. case 1:
  154. // (stare back at the old man's tiny, beady eyes)
  155. cm.sendSimple("#ethe old man pauses#n\r\n\r\nYes... I can see it in your oversized eyes. You thirst for a walk along #e#bMemory Lane#k#n.\r\n\r\n#L0#Uhm... actually, not really.#l\r\n#L1#Maybe. What is that?#l");
  156. break;
  157. }
  158. break;
  159. case 1:
  160. switch (selection) {
  161. case 0:
  162. // (keep walking back)
  163. cm.dispose();
  164. return;
  165. case 1:
  166. // W--What do you want?
  167. cm.sendSimple("Oh, nothing.\r\n\r\n#ethe old man's eyes wander slightly#n\r\n\r\nI just thought you might want a walk along #e#bMemory Lane#k#n.\r\n\r\n#L0#Uhm... actually, not really.#l\r\n#L1#Maybe. What is that?#l");
  168. break;
  169. }
  170. break;
  171. default:
  172. cm.dispose();
  173. return;
  174. }
  175. break;
  176. default:
  177. cm.dispose();
  178. return;
  179. }
  180. break;
  181. case 5:
  182. switch (selection) {
  183. case 1:
  184. cm.sendSimple("#e#bMemory Lane#k#n -- the road of past experiences. Of those who enter the Lane, only a handful make it back out; at least, make it back out #ralive#k.\r\n\r\nBut you look dumb--I mean, #estrong#n enough of mind and body to explore this Lane yourself.\r\n\r\nThere is only one thing you must do -- take a walk along your own private lane of memory.\r\n\r\n#L0#How do you mean?#l\r\n#L1#Hmm... doesn't sound fun.#l");
  185. break;
  186. default:
  187. cm.sendOk("Ah.\r\n\r\n#egoes back to reading#n");
  188. cm.dispose();
  189. return;
  190. }
  191. break;
  192. case 6:
  193. switch (selection) {
  194. case 0:
  195. cm.sendSimple("#ethe old man stands up a bit straighter#n\r\n\r\nTo go back to where you started, to relive your memories anew, for good and for poor.\r\n\r\nI can take you there, but only if you allow me to.\r\n\r\n#ethe old man closes his eyes for 2 or 3 seconds#n\r\n\r\n#e#rTo Maple Island, yes, I can take you.#k#n That is where you started, yes?\r\n\r\n#L0#Oh, I mean... all the way back there? I don't know about that.#l\r\n#L1#I... I suppose so. Can you take me there now?#l");
  196. break;
  197. default:
  198. cm.sendOk("Suit yourself.\r\n\r\n#ethe old man goes back to reading#n");
  199. cm.dispose();
  200. return;
  201. }
  202. break;
  203. case 7:
  204. switch (selection) {
  205. case 1:
  206. cm.warp(40000);
  207. cm.startCQuest(questIds[questIndex]);
  208. cm.dispose();
  209. return;
  210. default:
  211. cm.sendOk("Suit yourself.\r\n\r\n#ethe old man goes back to reading#n");
  212. cm.dispose();
  213. return;
  214. }
  215. break;
  216. }
  217. } else if (cm.onQuest(questIds[questIndex]) && cm.canComplete()) {
  218. switch (status) {
  219. case 0:
  220. cm.sendOk("#ethe old man almost seems to nod#n");
  221. break;
  222. case 1:
  223. p.setQuestCompletion(questNums[questIndex], true);
  224. cm.rewardPlayer(0, 0);
  225. cm.gainFame(12);
  226. p.sendHint(cm.randomText(6));
  227. cm.dispose();
  228. return;
  229. }
  230. } else {
  231. cm.sendOk("#econtinues reading silently as the ancient scroll in his hand slowly, but actively, falls to dust#n");
  232. cm.dispose();
  233. return;
  234. }
  235. break;
  236. case 1:
  237. break;
  238. case 2:
  239. break;
  240. }
  241. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement