9
3

ScholarDemini.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. --[[
  2. Script Name : SpawnScripts/NorthQeynos/ScholarDemini.lua
  3. Script Purpose : Scholar Demini
  4. Script Author : Dorbin
  5. Script Date : 2022.04.22
  6. Script Notes : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Age = 5550
  10. local Scholar = 5551
  11. local Rescue = 5552
  12. local Flight = 5553
  13. function spawn(NPC)
  14. ProvidesQuest(NPC,5550)
  15. ProvidesQuest(NPC,5551)
  16. ProvidesQuest(NPC,5552)
  17. ProvidesQuest(NPC,5553)
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function hailed(NPC, Spawn)
  23. if not HasQuest(Spawn,Age) and not HasCompletedQuest(Spawn,Age) then
  24. Dialog1(NPC, Spawn)
  25. elseif HasQuest(Spawn,Age) and GetQuestStep(Spawn,Age)~=6 then
  26. FaceTarget(NPC, Spawn)
  27. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_1_1034.mp3","Please, go hurry friend!","",0,0,Spawn)
  28. elseif HasQuest(Spawn,Age) and GetQuestStep(Spawn,Age)==6 then
  29. AgeDone(NPC,Spawn)
  30. elseif HasCompletedQuest(Spawn,Age) and not HasQuest(Spawn,Scholar) and not HasCompletedQuest(Spawn,Scholar) then
  31. ScholarSearch(NPC, Spawn)
  32. elseif HasQuest(Spawn,Scholar) and not GetQuestStep(Spawn,Scholar)~=9 then
  33. FaceTarget(NPC, Spawn)
  34. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_1_1034.mp3","Please, go hurry friend!","",0,0,Spawn)
  35. elseif HasQuest(Spawn,Scholar) and GetQuestStep(Spawn,Scholar)==9 then
  36. ScholarSearchDone(NPC, Spawn)
  37. elseif HasCompletedQuest(Spawn,Scholar) and not HasQuest(Spawn,Rescue) and not HasCompletedQuest(Spawn,Rescue) then
  38. ScholarRescue(NPC, Spawn)
  39. elseif HasQuest(Spawn,Rescue) and not GetQuestStep(Spawn,Rescue)~=6 then
  40. FaceTarget(NPC, Spawn)
  41. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_1_1034.mp3","Please, go hurry friend!","",0,0,Spawn)
  42. elseif HasQuest(Spawn,Rescue) and GetQuestStep(Spawn,Rescue)==9 then
  43. ScholarRescueDone(NPC, Spawn)
  44. elseif HasCompletedQuest(Spawn,Rescue) and not HasQuest(Spawn,Flight) and not HasCompletedQuest(Spawn,Flight) then
  45. FlightStart(NPC, Spawn)
  46. elseif HasQuest(Spawn,Flight) and not GetQuestStep(Spawn,Flight)~=10 then
  47. FaceTarget(NPC, Spawn)
  48. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_1_1034.mp3","Please, go hurry friend!","",0,0,Spawn)
  49. elseif HasQuest(Spawn,Flight) and GetQuestStep(Spawn,Flight)==10 then
  50. FlightDone(NPC, Spawn)
  51. elseif HasCompletedQuest(Spawn,Flight) then
  52. AllDone(NPC, Spawn)
  53. end
  54. end
  55. function Dialog1(NPC, Spawn)
  56. FaceTarget(NPC, Spawn)
  57. PlayFlavor(NPC,"","","sniff",0,0,Spawn)
  58. Dialog.New(NPC, Spawn)
  59. Dialog.AddDialog("Yes, you must be one of those adventurers, all right. If the stories about you folks are true, then I'm sure you're willing to undertake a dangerous task just for the thrill of it. Am I right?")
  60. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_1_1034.mp3", 0, 0)
  61. if not HasQuest(Spawn,5550) and not HasCompletedQuest(Spawn,5550) then
  62. Dialog.AddOption("That's not exactly how it works, friend. You're forgetting the 'goal' part.", "Dialog3")
  63. end
  64. Dialog.AddOption("Not right now, friend.")
  65. Dialog.Start()
  66. end
  67. function StartQuest(NPC,Spawn)
  68. FaceTarget(NPC, Spawn)
  69. OfferQuest(NPC,Spawn,5550)
  70. end
  71. function Dialog3(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. Dialog.New(NPC, Spawn)
  74. PlayFlavor(NPC,"","","orate",0,0,Spawn)
  75. Dialog.AddDialog("Oh yes, the mysterious items of mystical magic part! Yes, yes, I know all about that too! You see, my name is Demini, and I'm a historian who has read all about you people.")
  76. Dialog.AddOption("Yes, I guess you could put it that way. Is there anything you need, friend?", "Dialog4")
  77. Dialog.AddOption("I don't want to keep you from your studies. I must be off.")
  78. Dialog.Start()
  79. end
  80. function Dialog4(NPC, Spawn)
  81. FaceTarget(NPC, Spawn)
  82. PlayFlavor(NPC,"","","doh",0,0,Spawn)
  83. Dialog.New(NPC, Spawn)
  84. Dialog.AddDialog("What am I thinking? I'm not even doing this right! Brave adventurer, I have a noble quest for you. In return for you undertaking this dangerous task, I shall grant you a mysterious artifact from my personal collection. How's that?")
  85. Dialog.AddOption("Good enough, Demini. Why don't you just tell me what you need?", "StartQuest")
  86. Dialog.AddOption("Close enough, but I'm a bit busy right now. Perhaps another time.")
  87. Dialog.Start()
  88. end
  89. function AgeDone(NPC,Spawn)
  90. FaceTarget(NPC, Spawn)
  91. Dialog.New(NPC, Spawn)
  92. PlayFlavor(NPC,"","","happy",0,0,Spawn)
  93. SetStepComplete(Spawn,Age, 6)
  94. Dialog.AddDialog("Oh my, oh my! You found the pages! Excellent! As promised, here's your reward, bold adventurer! Haha! I've always wanted to say that! Now let me look at these pages... yes, yes... just as I thought.. Iit was a diary! And a recent one, too! Oh my! It seems the attendant was actually here! In Karan! Maybe he or she is still nearby!")
  95. Dialog.AddOption("Why is this person so important?", "Option1")
  96. Dialog.AddOption("I'm actually out of time.")
  97. Dialog.Start()
  98. end
  99. --Quest 2 -------------------------------------------------------
  100. function ScholarSearch(NPC, Spawn)
  101. FaceTarget(NPC, Spawn)
  102. Dialog.New(NPC, Spawn)
  103. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_2_1034.mp3","","hello",0,0,Spawn)
  104. Dialog.AddDialog("Oh, it's you, bold adventurer! How can I help you?")
  105. Dialog.AddOption("I have some time to offer my assistance. What was it you needed?", "Option1")
  106. Dialog.AddOption("I don't need anything. I was just saying hello.")
  107. Dialog.Start()
  108. end
  109. function Option1(NPC, Spawn)
  110. FaceTarget(NPC, Spawn)
  111. Dialog.New(NPC, Spawn)
  112. PlayFlavor(NPC,"","","orate",0,0,Spawn)
  113. Dialog.AddDialog("Well, you see, the Sage of Ages is almost a myth. He is a timeless being who relates the events of the Ages after they've passed. This journal was written by one of the scholars who records the Sage's tales. Umm... perhaps you could do something else for me?")
  114. Dialog.AddOption("I've got time on my hands. What do you need now?", "StartQuest2")
  115. Dialog.AddOption("I'm a bit busy. Maybe later.")
  116. Dialog.Start()
  117. end
  118. function StartQuest2(NPC,Spawn)
  119. FaceTarget(NPC, Spawn)
  120. OfferQuest(NPC,Spawn,5551)
  121. end
  122. function ScholarSearchDone(NPC, Spawn)
  123. FaceTarget(NPC, Spawn)
  124. Dialog.New(NPC, Spawn)
  125. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_2_1034.mp3","","boggle",0,0,Spawn)
  126. Dialog.AddDialog("This is both the best and the worst news I've ever heard. The Sage of Ages is actually real! But from what you say, he's likely been ... killed! Oh, this is horrible. Ah... I nearly forgot ... here, adventurer. This is for bringing me this great and horrible news.")
  127. Dialog.AddOption("Maybe the Sage isn't dead? Maybe he's still out there?", "Option1")
  128. Dialog.AddOption("Good luck figuring that out! I have to go.")
  129. Dialog.Start()
  130. SetStepComplete(Spawn,Scholar, 9)
  131. end
  132. --Quest 3 ------------------------------------------------------- 'NEVER JUDGE A BOOK BY ITS COVER' QUEST
  133. function ScholarRescue(NPC, Spawn)
  134. FaceTarget(NPC, Spawn)
  135. Dialog.New(NPC, Spawn)
  136. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_2_1034.mp3","","hello",0,0,Spawn)
  137. Dialog.AddDialog("Oh, it's you, bold adventurer! How can I help you?")
  138. Dialog.AddOption("You mentioned the Sage of Ages could be in danger.", "Option1a")
  139. Dialog.AddOption("I don't need anything. I was just saying hello.")
  140. Dialog.Start()
  141. end
  142. function Option1a(NPC, Spawn)
  143. FaceTarget(NPC, Spawn)
  144. Dialog.New(NPC, Spawn)
  145. PlayFlavor(NPC,"","","confused",0,0,Spawn)
  146. Dialog.AddDialog("Do you really think he's out there? According to that page you found, he and the scholar most assuredly were killed by those bandits.")
  147. Dialog.AddOption("Maybe he was taken hostage? Perhaps I can free him?", "StartQuest3")
  148. Dialog.AddOption("I guess you'll have to send someone else to check.")
  149. Dialog.Start()
  150. end
  151. function StartQuest3(NPC,Spawn)
  152. FaceTarget(NPC, Spawn)
  153. OfferQuest(NPC,Spawn,5552)
  154. end
  155. function ScholarRescueDone(NPC, Spawn)
  156. FaceTarget(NPC, Spawn)
  157. Dialog.New(NPC, Spawn)
  158. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_3_1034.mp3","","thanks",0,0,Spawn)
  159. Dialog.AddDialog("Well, this is good news! They let him go. They thought he was nothing more than a simple peasant! There's hope yet! Here, take this! If the Sage has run off to the Steppes, he may be safe... oh no... he'll be safe from the bandits but not the centaurs.")
  160. Dialog.AddOption("Maybe I can find him in time?", "Option1b")
  161. Dialog.AddOption("I'm a bit busy. Maybe later.")
  162. Dialog.Start()
  163. SetStepComplete(Spawn,Rescue, 6)
  164. end
  165. --Quest 4 ------------------------------------------------------- FLIGHT OF THE SAGE QUEST
  166. function FlightStart(NPC, Spawn)
  167. FaceTarget(NPC, Spawn)
  168. Dialog.New(NPC, Spawn)
  169. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_2_1034.mp3","","hello",0,0,Spawn)
  170. Dialog.AddDialog("Oh, it's you, bold adventurer! How can I help you?")
  171. Dialog.AddOption("Do you think it's too late to find the Sage of Ages?", "Option1b")
  172. Dialog.AddOption("I don't need anything. I was just saying hello.")
  173. Dialog.Start()
  174. end
  175. function Option1b(NPC, Spawn)
  176. FaceTarget(NPC, Spawn)
  177. Dialog.New(NPC, Spawn)
  178. PlayFlavor(NPC,"","","shrug",0,0,Spawn)
  179. Dialog.AddDialog("I don't know. The Sage of Ages hasn't lived as long as he has without knowing a trick or two. I guess you can look for him, but I'm still worried. I've already asked you to do much for me, but...")
  180. Dialog.AddOption("I've come this far, Demini. I want to see this Sage of Ages person face to face!", "StartQuest4")
  181. Dialog.AddOption("I'm sorry, Demini. I'm a bit tied up right now.")
  182. Dialog.Start()
  183. end
  184. function StartQuest4(NPC,Spawn)
  185. FaceTarget(NPC, Spawn)
  186. OfferQuest(NPC,Spawn,5553)
  187. end
  188. function FlightDone(NPC, Spawn)
  189. FaceTarget(NPC, Spawn)
  190. Dialog.New(NPC, Spawn)
  191. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_3_1034.mp3","","thanks",0,0,Spawn)
  192. Dialog.AddDialog("Drat! So close, too. To think... I could have met the Sage of Ages. But now he's sailing off to wherever it is that he observes the world. Oh well. Friend, I want to thank you for helping me. Please, take this as a sign of my appreciation. As for me... I might as well record what could have happened. Good luck to you, bold and brave adventurer.")
  193. Dialog.AddOption("After all that, it is a shame to have not seen the Sage of Ages myself. Take care Demini.")
  194. Dialog.AddOption("I'm glad I could be apart of the search. Good luck writing about it Demini.")
  195. Dialog.Start()
  196. SetStepComplete(Spawn,Flight, 10)
  197. end
  198. --DONE w/ ALL Quests
  199. function AllDone(NPC, Spawn)
  200. FaceTarget(NPC, Spawn)
  201. PlayFlavor(NPC,"voiceover/english/voice_emotes/greetings/greetings_3_1034.mp3","Thank you so much for your help, friend. I've even made an entry about you in my book!","hello",0,0,Spawn)
  202. end