CryptkeeperMaglus.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. --[[
  2. Script Name : SpawnScripts/CryptBetrayal/CryptkeeperMaglus.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.15 08:10:01
  5. Script Purpose :
  6. :
  7. --]]
  8. local ForgottenPotion = 5372
  9. local ForgottenPotionIntoTheHive = 5373
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 15, "InRange")
  12. end
  13. function InRange(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. if not HasCompletedQuest(Spawn, ForgottenPotion) then
  16. PlayFlavor(NPC, "", "Two ... no, no ... five more. Wait, seven more ... I keep losing track!", "", 1689589577, 4560189, Spawn)
  17. elseif HasCompletedQuest(Spawn, ForgottenPotion) and not HasCompletedQuest(Spawn, ForgottenPotionIntoTheHive) then
  18. PlayFlavor(NPC, "", "Oh, no! Now I need something else for this potion!", "", 1689589577, 4560189, Spawn)
  19. end
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. if not HasQuest(Spawn, ForgottenPotion) and not HasCompletedQuest(Spawn, ForgottenPotion) then
  24. first_quest(NPC, Spawn)
  25. elseif HasQuest(Spawn, ForgottenPotion) then
  26. local conversation = CreateConversation()
  27. if GetQuestStep(Spawn, ForgottenPotion) == 2 then
  28. AddConversationOption(conversation, "Yes, I have them right here.", "Option4")
  29. end
  30. AddConversationOption(conversation, "No, not yet.", "Option3")
  31. StartConversation(conversation, NPC, Spawn, "Good to see you again! Did you get those wings?")
  32. elseif HasCompletedQuest(Spawn, ForgottenPotion) and not HasQuest(Spawn, ForgottenPotionIntoTheHive) and not HasCompletedQuest(Spawn, ForgottenPotionIntoTheHive) then
  33. second_quest(NPC, Spawn)
  34. elseif HasQuest(Spawn, ForgottenPotionIntoTheHive) and GetQuestStep(Spawn, ForgottenPotionIntoTheHive) <= 2 then
  35. local conversation = CreateConversation()
  36. if GetQuestStep(Spawn, ForgottenPotionIntoTheHive) == 2 then
  37. AddConversationOption(conversation, "Yes, I have them right here.", "Option8")
  38. end
  39. AddConversationOption(conversation, "No, not yet.", "Option7")
  40. StartConversation(conversation, NPC, Spawn, "Breathe slowly, carefully now ... Ah, hello again! Have you got the deathly scarab antennae?")
  41. elseif GetQuestStep(Spawn, ForgottenPotionIntoTheHive) == 3 or GetQuestStep(Spawn, ForgottenPotionIntoTheHive) == 4 or GetQuestStep(Spawn, ForgottenPotionIntoTheHive) == 5 then
  42. second_quest_progress(NPC, Spawn)
  43. elseif HasCompletedQuest(Spawn, ForgottenPotion) and HasCompletedQuest(Spawn, ForgottenPotionIntoTheHive) then
  44. PlayFlavor(NPC, "", "This potion is great! Thank you for helping me!", "", 1689589577, 4560189, Spawn)
  45. end
  46. end
  47. function first_quest(NPC, Spawn)
  48. local conversation = CreateConversation()
  49. AddConversationOption(conversation, "What are you doing?", "Option1")
  50. AddConversationOption(conversation, "Good luck finding them.")
  51. StartConversation(conversation, NPC, Spawn, "Ah, how convenient for me! Give me a moment to think. Yes, I definitely need five more sets of wings.")
  52. end
  53. function second_quest(NPC, Spawn)
  54. local conversation = CreateConversation()
  55. AddConversationOption(conversation, "On the ceiling?", "Option5")
  56. AddConversationOption(conversation, "I'll be on my way, then.")
  57. StartConversation(conversation, NPC, Spawn, "Your timing is impeccable! You see, this potion I'm concocting is very volatile. It can explode at any minute! Ka-BOOM! And then where would we be, eh?")
  58. end
  59. function second_quest_progress(NPC, Spawn)
  60. local conversation = CreateConversation()
  61. if GetQuestStep(Spawn, ForgottenPotionIntoTheHive) == 5 then
  62. AddConversationOption(conversation, "I have the antennae and I have slain the deathly beetle queen.", "Option14")
  63. end
  64. AddConversationOption(conversation, "Sorry, I will be back soon.")
  65. StartConversation(conversation, NPC, Spawn, "What are you doing back here so soon? You better have the antennae, or are you trying to make me go ka-Boom?")
  66. end
  67. function Option1(NPC, Spawn)
  68. FaceTarget(NPC, Spawn)
  69. local conversation = CreateConversation()
  70. AddConversationOption(conversation, "Do you need help?", "Option2")
  71. AddConversationOption(conversation, "Six, eight, ten...I wish you luck.")
  72. StartConversation(conversation, NPC, Spawn, "I'm preparing the ingredients for a potion, and with all the running around I have to do, I lose track now and then. Now, where was I? Oh, yes. Wings. One, two, four... that can't be right!")
  73. end
  74. function Option2(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. local conversation = CreateConversation()
  77. AddConversationOption(conversation, "Absolutely. I will get you the wings you need.", "offer")
  78. AddConversationOption(conversation, "No, I cannot help you.")
  79. StartConversation(conversation, NPC, Spawn, "Yes, thanks for offering! I need ten more wings from some of these shrillers. Can you help me?")
  80. end
  81. function Option3(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. local conversation = CreateConversation()
  84. AddConversationOption(conversation, "I will be back.")
  85. StartConversation(conversation, NPC, Spawn, "Hurry up! These potions are delicate things, and I need those shriller wings.")
  86. end
  87. function Option4(NPC, Spawn)
  88. SetStepComplete(Spawn, ForgottenPotion, 2)
  89. FaceTarget(NPC, Spawn)
  90. local conversation = CreateConversation()
  91. AddConversationOption(conversation, "You're welcome.")
  92. StartConversation(conversation, NPC, Spawn, "Glad you stumbled across me when you did. I sure need those wings. These'll come in handy. Thanks!")
  93. end
  94. function Option5(NPC, Spawn)
  95. FaceTarget(NPC, Spawn)
  96. local conversation = CreateConversation()
  97. AddConversationOption(conversation, "I suppose I can. What do you need now?", "Option6")
  98. AddConversationOption(conversation, "Sorry, can't spare the time right now.")
  99. StartConversation(conversation, NPC, Spawn, "Ha! You find this amusing, do you? If I don't finish this potion soon, the volatility will only increase. If you can spare some time, perhaps you could gather another component for me? Please?")
  100. end
  101. function Option6(NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. local conversation = CreateConversation()
  104. AddConversationOption(conversation, "Definitely. I will get you fifteen beetle antennae.", "offer2")
  105. AddConversationOption(conversation, "No, I cannot help you.")
  106. StartConversation(conversation, NPC, Spawn, "Splendid! This saves me gobs of time, you have no idea! The recipe calls for fifteen deadly scarab antennae. Disgusting creatures. You can't help but find these scarabs throughout these catacombs. Handy, isn't it?")
  107. end
  108. function Option7(NPC, Spawn)
  109. FaceTarget(NPC, Spawn)
  110. local conversation = CreateConversation()
  111. AddConversationOption(conversation, "I'll be back.")
  112. StartConversation(conversation, NPC, Spawn, "The sooner you get back with fifteen of those deathly scarab antennae, the lower the chance of Ka-BOOM!")
  113. end
  114. function Option8(NPC, Spawn)
  115. FaceTarget(NPC, Spawn)
  116. local conversation = CreateConversation()
  117. AddConversationOption(conversation, "What's wrong?", "Option9")
  118. AddConversationOption(conversation, "Let me get back to you on this. ")
  119. StartConversation(conversation, NPC, Spawn, "This is great! Well ... Wait ... No!")
  120. end
  121. function Option9(NPC, Spawn)
  122. SetStepComplete(Spawn, ForgottenPotionIntoTheHive, 2)
  123. FaceTarget(NPC, Spawn)
  124. local conversation = CreateConversation()
  125. AddConversationOption(conversation, "I don't understand. A deathly scarab is a deathly scarab, right?", "Option10")
  126. AddConversationOption(conversation, "I remembered something else I have to do right now. See you around.")
  127. StartConversation(conversation, NPC, Spawn, "I realized after you walked off, that I made a mistake. And, of course, it's not a small one. You see, these aren't from the right type of deathly scarab, that's why I stopped collecting them myself.")
  128. end
  129. function Option10(NPC, Spawn)
  130. FaceTarget(NPC, Spawn)
  131. local conversation = CreateConversation()
  132. AddConversationOption(conversation, "Ka-BOOM?", "Option11")
  133. AddConversationOption(conversation, "I'll be back later.")
  134. StartConversation(conversation, NPC, Spawn, "Oh ... no. They're not the same at all. There's the common deathly scarab, and then there's another type. Looks almost exactly the same, but its chemical composition is radically different. And that means...")
  135. end
  136. function Option11(NPC, Spawn)
  137. FaceTarget(NPC, Spawn)
  138. local conversation = CreateConversation()
  139. AddConversationOption(conversation, "Let me guess, you want me to find the nest?", "Option12")
  140. AddConversationOption(conversation, "This doesn't interest me right now.")
  141. StartConversation(conversation, NPC, Spawn, "...Ka-BOOM! Exactly! Hmm, you know? There's a reason these other deathly scarabs are showing up more frequently down here. I bet the ones we need are back protecting the Queen in her lair.")
  142. end
  143. function Option12(NPC, Spawn)
  144. FaceTarget(NPC, Spawn)
  145. local conversation = CreateConversation()
  146. AddConversationOption(conversation, "(continue)", "Option13")
  147. StartConversation(conversation, NPC, Spawn, "That would make things much safer around here. I mean, one wrong component in this potion, and well ... it wouldn't be pretty. Since these look-alike deadly scarabs are here in the catacombs, I assume the ones I need are in their nest.")
  148. end
  149. function Option13(NPC, Spawn)
  150. FaceTarget(NPC, Spawn)
  151. local conversation = CreateConversation()
  152. AddConversationOption(conversation, "All right, I will find and destroy the deathly scarab queen.")
  153. StartConversation(conversation, NPC, Spawn, "Every bug nest has its queen. If you destroy their queen, the number of abnormal deadly scarabs will reduce to nothing. Here, take this key and enter the doorway at the top of the staircase. The tunnels will lead to her chambers.")
  154. end
  155. function Option14(NPC, Spawn)
  156. SetStepComplete(Spawn, ForgottenPotionIntoTheHive, 5)
  157. FaceTarget(NPC, Spawn)
  158. local conversation = CreateConversation()
  159. AddConversationOption(conversation, "Thank you.")
  160. StartConversation(conversation, NPC, Spawn, "Great! These antennae are sure to do the trick. Stand back a moment ... a pinch here, a pinch there and ... YES! The potion is stable, excellent work. Here, please take this as a token of my appreciation.")
  161. end
  162. function offer(NPC, Spawn)
  163. OfferQuest(NPC, Spawn, ForgottenPotion)
  164. end
  165. function offer2(NPC, Spawn)
  166. OfferQuest(NPC, Spawn, ForgottenPotionIntoTheHive)
  167. end
  168. function respawn(NPC)
  169. spawn(NPC)
  170. end