AluciusValus.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. --[[
  2. Script Name : SpawnScripts/BeggarsCourt/AluciusValus.lua
  3. Script Purpose : Alucius Valus
  4. Script Author : torsten
  5. Script Date : 2022.07.17
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local FindingtheStash = 5667
  10. local SavingHistory = 5668
  11. local BigTroubleBeggarsCourt = 5669
  12. local TrickingtheTraitor = 5670
  13. function spawn(NPC)
  14. ProvidesQuest(NPC, FindingtheStash)
  15. ProvidesQuest(NPC, SavingHistory)
  16. ProvidesQuest(NPC, BigTroubleBeggarsCourt)
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function hailed(NPC, Spawn)
  22. local race = GetRace(Spawn)
  23. if race == 9 then --human restricted
  24. if not HasQuest(Spawn, FindingtheStash) and not HasCompletedQuest(Spawn, FindingtheStash) then
  25. Dialog20(NPC, Spawn)
  26. end
  27. if HasCompletedQuest(Spawn, FindingtheStash) then
  28. if not HasQuest(Spawn, SavingHistory) and not HasCompletedQuest(Spawn, SavingHistory) then
  29. Dialog13(NPC, Spawn)
  30. end
  31. end
  32. if HasCompletedQuest(Spawn, SavingHistory) then
  33. if not HasQuest(Spawn, BigTroubleBeggarsCourt) and not HasCompletedQuest(Spawn, BigTroubleBeggarsCourt) then
  34. Dialog14(NPC, Spawn)
  35. end
  36. end
  37. if GetQuestStep(Spawn, FindingtheStash) == 2 then
  38. SetStepComplete(Spawn, FindingtheStash, 2)
  39. Dialog13(NPC, Spawn)
  40. end
  41. if GetQuestStep(Spawn, SavingHistory) == 2 then
  42. SetStepComplete(Spawn, SavingHistory, 2)
  43. Dialog14(NPC, Spawn)
  44. end
  45. if GetQuestStep(Spawn, BigTroubleBeggarsCourt) == 3 then
  46. SetStepComplete(Spawn, BigTroubleBeggarsCourt, 3)
  47. Dialog30(NPC, Spawn)
  48. end
  49. if GetQuestStep(Spawn, TrickingtheTraitor) == 1 then
  50. SetStepComplete(Spawn, TrickingtheTraitor, 1)
  51. Dialog16(NPC, Spawn)
  52. end
  53. end
  54. RandomGreeting(NPC, Spawn)
  55. end
  56. function RandomGreeting(NPC, Spawn)
  57. local choice = MakeRandomInt(1,4)
  58. if choice == 1 then
  59. PlayFlavor(NPC, "", "I am not quite sure what you are, but I don't want to talk to you.", "", 0, 0, Spawn, 0)
  60. elseif choice == 2 then
  61. PlayFlavor(NPC, "", "Finish the task I have set before, then return to me.", "", 0, 0, Spawn, 0)
  62. elseif choice == 3 then
  63. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3", 0, 0, Spawn)
  64. elseif choice == 4 then
  65. PlayVoice(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1004.mp3", 0, 0, Spawn)
  66. end
  67. end
  68. --=========================== Quest 1
  69. function Dialog20(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("Greetings my friend, it looks like you may be in need of work, information, or both.")
  73. Dialog.AddOption("Work. I could definitely use some work.", "Dialog19")
  74. Dialog.AddOption("Information is always helpful. What is it you want to tell me?", "Dialog19")
  75. Dialog.AddOption("Actually, I don't want either right now. Have a good day.")
  76. Dialog.Start()
  77. end
  78. function Dialog19(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("Information is important, and you are wise to seek as much as you can. Because of this, I will give you a few free tips.")
  82. Dialog.AddOption("What tips would those be?", "Dialog26")
  83. Dialog.Start()
  84. end
  85. function Dialog26(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. Dialog.New(NPC, Spawn)
  88. Dialog.AddDialog("First, you must understand who you are and where you are. You are a human, and you are in Freeport. This is very important. We are the top dogs around here. Be sure you do not allow yourself to take any flak from the lesser beings that live in the other districts of the city.")
  89. Dialog.AddOption("Is there anything else I should know?", "Dialog15")
  90. Dialog.AddOption("I think I'll be leaving.")
  91. Dialog.Start()
  92. end
  93. function Dialog15(NPC, Spawn)
  94. FaceTarget(NPC, Spawn)
  95. Dialog.New(NPC, Spawn)
  96. Dialog.AddDialog("You are right, I need to tell you the most important rule. It's real simple... never cross the Overlord. We exist only because of his might. Without him, Freeport would have been destroyed long ago. And remember, he does not take kindly to traitors.")
  97. Dialog.AddOption("You said something about work you needed done.", "Dialog21")
  98. Dialog.AddOption("Thanks for the information. I will be leaving now.")
  99. Dialog.Start()
  100. end
  101. function Dialog21(NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. Dialog.New(NPC, Spawn)
  104. Dialog.AddDialog("Ah good, I was hoping you would be in need of work. I could use a hand right now. Of course, you will need at least a bit of the courage our great Overlord shows, as well as the ability to take destiny into your own hands. Yes, that is the kind of person I am looking for. You still up for the job?")
  105. Dialog.AddOption("Sure, I am up for it. Sounds intriguing.", "Dialog3")
  106. Dialog.AddOption("Sounds a bit too dangerous for me right now. I may be back later, though.")
  107. Dialog.Start()
  108. end
  109. function Dialog3(NPC, Spawn)
  110. FaceTarget(NPC, Spawn)
  111. Dialog.New(NPC, Spawn)
  112. Dialog.AddDialog("I knew you would be. After all, we humans have overcome every obstacle put before us so far. A little task like this shouldn't throw you off, unlike that hideous rat that used to work for me.")
  113. Dialog.AddOption("Rat? I do not think I understand.", "Dialog22")
  114. Dialog.Start()
  115. end
  116. function Dialog22(NPC, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. Dialog.New(NPC, Spawn)
  119. Dialog.AddDialog("You know, a ratonga. A rat man. The cowardly flea bags that live in the sewers. Oh, don't worry about it. Here is what I need you to do. See, there was this guy who used to live near here. He used to talk about how no one would ever find his goods. Well, he vanished not too long ago. Word is, he was right, no one has found his stash yet.")
  120. Dialog.AddOption("So why don't you get it yourself?", "Dialog9")
  121. Dialog.AddOption("Find someone else to run your errand.")
  122. Dialog.Start()
  123. end
  124. function Dialog9(NPC, Spawn)
  125. FaceTarget(NPC, Spawn)
  126. Dialog.New(NPC, Spawn)
  127. Dialog.AddDialog("Well, see, here is the problem. I am known around here. It would look fishy if I was seen wandering around his old place. But you're new to town. Most people would just assume that you are lost and not think twice about it.")
  128. Dialog.AddOption("What if I just take it for myself?", "Dialog18")
  129. Dialog.Start()
  130. end
  131. function Dialog18(NPC, Spawn)
  132. FaceTarget(NPC, Spawn)
  133. Dialog.New(NPC, Spawn)
  134. Dialog.AddDialog("You don't want to do that. I would turn you over to the Militia as a thief. And if you try to turn me over to them, I will just deny the plan and they will confiscate the goods. But if you work for me, you'll collect a nice fee for retrieving some poor drunkard's discarded junk. It's a winning proposition all around, don't you agree?")
  135. Dialog.AddOption("You make a good point. Where was that house located?", "Dialog25")
  136. Dialog.AddOption("Actually, I think I will take this opportunity to depart.")
  137. Dialog.Start()
  138. end
  139. function Dialog25(NPC, Spawn)
  140. FaceTarget(NPC, Spawn)
  141. Dialog.New(NPC, Spawn)
  142. Dialog.AddDialog("I knew you would see it my way. His house is located on the far west side of Beggar's Court. It is the northernmost door on that wall. Be sure to check under every crate and barrel, even the broken ones.")
  143. Dialog.AddOption("Just have my money ready.", "Dialog1")
  144. Dialog.Start()
  145. end
  146. function Dialog1(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. Dialog.New(NPC, Spawn)
  149. Dialog.AddDialog("Your money will be here waiting for you. You will get it as soon as I get what is mine.")
  150. Dialog.AddOption("Okay, I will be back soon.")
  151. Dialog.Start()
  152. OfferQuest(NPC, Spawn, FindingtheStash)
  153. end
  154. --============================= Quest 2
  155. function Dialog13(NPC, Spawn)
  156. FaceTarget(NPC, Spawn)
  157. Dialog.New(NPC, Spawn)
  158. Dialog.AddDialog("You're back. Did you find the hidden items I asked for?")
  159. Dialog.AddOption("Yes, I found the stash.", "Dialog4")
  160. Dialog.AddOption("We'll discuss this later.")
  161. Dialog.Start()
  162. end
  163. function Dialog4(NPC, Spawn)
  164. FaceTarget(NPC, Spawn)
  165. Dialog.New(NPC, Spawn)
  166. Dialog.AddDialog("Well, give it to me already! I am paying you for it, after all!")
  167. Dialog.AddOption("Fine, take it. You could stand to be more polite.", "Dialog6")
  168. Dialog.Start()
  169. end
  170. function Dialog6(NPC, Spawn)
  171. FaceTarget(NPC, Spawn)
  172. Dialog.New(NPC, Spawn)
  173. Dialog.AddDialog("Bah, this is mostly trash, and certainly isn't worth much. You're lucky that I am an honest person. If not, I would send you on your way empty-handed. Let me look through all of this garbage. Come back when I am done, and I will have more work for you. ")
  174. Dialog.AddOption("I'm ready for more work now.", "Dialog7")
  175. Dialog.AddOption("I will see you again shortly then.")
  176. Dialog.Start()
  177. end
  178. function Dialog7(NPC, Spawn)
  179. FaceTarget(NPC, Spawn)
  180. Dialog.New(NPC, Spawn)
  181. Dialog.AddDialog("You did well on your last assignment. I have more work for you, if you're up to it. I found an interesting note in that bag of junk you sold me which may explain its owner's sudden disappearance.")
  182. Dialog.AddOption("I'm up for it. What sort of note?", "Dialog28")
  183. Dialog.AddOption("I am busy right now. I'll check back later to see if you still need assistance.")
  184. Dialog.Start()
  185. end
  186. function Dialog28(NPC, Spawn)
  187. FaceTarget(NPC, Spawn)
  188. Dialog.New(NPC, Spawn)
  189. Dialog.AddDialog("The note mentions a shady cohort who has documents regarding the last war Freeport saw. These documents apparently contradict the history of our great Overlord's triumph. I want you to go take the documents from him, by any means necessary.")
  190. Dialog.AddOption("Any means necessary? Why don't you just turn him in to the Militia?", "Dialog5")
  191. Dialog.AddOption("That sounds a bit dangerous. Maybe I will come back later.")
  192. Dialog.Start()
  193. end
  194. function Dialog5(NPC, Spawn)
  195. FaceTarget(NPC, Spawn)
  196. Dialog.New(NPC, Spawn)
  197. Dialog.AddDialog("That thought did cross my mind. But I'm interested in seeing what the note says, and this will be a good chance for you to prove your loyalty to Freeport. You should go now. According to my information, this shady fellow is in the far southeast room here in Beggar's Court.")
  198. Dialog.AddOption("Do not worry, I will get the documents for you.", "Dialog31")
  199. Dialog.Start()
  200. end
  201. function Dialog31(NPC, Spawn)
  202. FaceTarget(NPC, Spawn)
  203. Dialog.New(NPC, Spawn)
  204. Dialog.AddDialog("The sooner you get back, the better off everyone will be. So get going!")
  205. Dialog.AddOption("I will be back soon.")
  206. Dialog.Start()
  207. OfferQuest(NPC, Spawn, SavingHistory)
  208. end
  209. --============================== Quest 3
  210. function Dialog14(NPC, Spawn)
  211. FaceTarget(NPC, Spawn)
  212. Dialog.New(NPC, Spawn)
  213. Dialog.AddDialog("You're back, and I see some papers in your hands. I assume those are the documents I requested. Hand them over so I can take a look.")
  214. Dialog.AddOption("Why are you so interested in a traitor's words?", "Dialog23")
  215. Dialog.AddOption("I will return later.")
  216. Dialog.Start()
  217. end
  218. function Dialog23(NPC, Spawn)
  219. FaceTarget(NPC, Spawn)
  220. Dialog.New(NPC, Spawn)
  221. Dialog.AddDialog("Remember, we must know our enemies if we are to adapt and overcome them. Now, give me a moment to look these over. Hmm... interesting.")
  222. Dialog.AddOption("Good point. So what is in those documents?", "Dialog17")
  223. Dialog.Start()
  224. end
  225. function Dialog17(NPC, Spawn)
  226. FaceTarget(NPC, Spawn)
  227. Dialog.New(NPC, Spawn)
  228. Dialog.AddDialog("These papers contradict the truth of our Overlord's great triumph in the Rallosian war. It is well known that he almost single-handedly defeated the enemy, but these documents attempt to undermine that greatness. I will of course turn them over to the proper authorities very soon.")
  229. Dialog.AddOption("Good. Is there anything else you need a hand with?", "Dialog10")
  230. Dialog.AddOption("I will be back soon.")
  231. Dialog.Start()
  232. end
  233. function Dialog10(NPC, Spawn)
  234. FaceTarget(NPC, Spawn)
  235. Dialog.New(NPC, Spawn)
  236. Dialog.AddDialog("Well, Gaikichi, it is time for you to learn more about Beggar's Court. I need you to do a bit more leg work for me.")
  237. Dialog.AddOption("What might that be?", "Dialog11")
  238. Dialog.AddOption("I will return later.")
  239. Dialog.Start()
  240. end
  241. function Dialog11(NPC, Spawn)
  242. FaceTarget(NPC, Spawn)
  243. Dialog.New(NPC, Spawn)
  244. Dialog.AddDialog("Beggar's Court is more than what it seems at first glance. You see, this is actually the hottest black market in all of Freeport. If you have the right connections, you can find almost anything you want here. It is also a great place to get rid of trinkets you no longer want.")
  245. Dialog.AddOption("I would not have guessed it from the look of the place.", "Dialog24")
  246. Dialog.AddOption("That is good to know.")
  247. Dialog.Start()
  248. end
  249. function Dialog24(NPC, Spawn)
  250. FaceTarget(NPC, Spawn)
  251. Dialog.New(NPC, Spawn)
  252. Dialog.AddDialog("Good, that's the way we want it to seem. To help you learn your way around, I have a package I need you to deliver for me. The buyer is a man named Durio Dexus. As you run south through Beggar's Court, you will find him just beyond the southeastern stair case. Be careful not to let him fool you... he's a crafty one.")
  253. Dialog.AddOption("Sounds easy enough.", "Dialog32")
  254. Dialog.AddOption("No thanks.")
  255. Dialog.Start()
  256. end
  257. function Dialog32(NPC, Spawn)
  258. FaceTarget(NPC, Spawn)
  259. Dialog.New(NPC, Spawn)
  260. Dialog.AddDialog("Just go sell my package to Durio Dexus. I'll give you a split of the profits. But the longer you take, the smaller your share becomes.")
  261. Dialog.AddOption("I will be back soon.")
  262. Dialog.Start()
  263. OfferQuest(NPC, Spawn, BigTroubleBeggarsCourt)
  264. end
  265. --============================== Quest 3 - Step 3
  266. function Dialog30(NPC, Spawn)
  267. FaceTarget(NPC, Spawn)
  268. Dialog.New(NPC, Spawn)
  269. Dialog.AddDialog("You are back, but it doesn't look like you have either my goods or my money.")
  270. Dialog.AddVoiceover("voiceover/english/voice_emotes/greetings/greetings_2_1004.mp3", 0, 0)
  271. Dialog.AddOption("You are right, I have neither.", "Dialog29")
  272. Dialog.AddOption("Maybe I will come back later.")
  273. Dialog.Start()
  274. end
  275. function Dialog29(NPC, Spawn)
  276. FaceTarget(NPC, Spawn)
  277. Dialog.New(NPC, Spawn)
  278. Dialog.AddDialog("Do you realize what happens to people who cross me?")
  279. Dialog.AddOption("Indeed I do. I heard all about your ratonga friend.", "Dialog8")
  280. Dialog.Start()
  281. end
  282. function Dialog8(NPC, Spawn)
  283. FaceTarget(NPC, Spawn)
  284. Dialog.New(NPC, Spawn)
  285. Dialog.AddDialog("What? So, you think you're smart, do you? You will end up just like him.")
  286. Dialog.AddOption("I doubt that. The Freeport Militia was quite pleased to receive those documents.", "Dialog2")
  287. Dialog.AddOption("No problem, I'll leave.")
  288. Dialog.Start()
  289. end
  290. function Dialog2(NPC, Spawn)
  291. FaceTarget(NPC, Spawn)
  292. Dialog.New(NPC, Spawn)
  293. Dialog.AddDialog("You trying to threaten me? Are you saying you'll turn me over to the Freeport Militia?")
  294. Dialog.AddOption("I don't need to threaten you. But you should know that the Militia will be watching out for me.")
  295. Dialog.AddOption("I don't want trouble. I'll leave you alone.")
  296. Dialog.Start()
  297. end
  298. --============================= Quest 4 Step 1
  299. function Dialog16(NPC, Spawn)
  300. FaceTarget(NPC, Spawn)
  301. Dialog.New(NPC, Spawn)
  302. Dialog.AddDialog("So, you're using the Militia to protect yourself and raise your standing with the Overlord at the same time. Quite clever, I must admit. I should have stuck to hiring the lesser races. You're lucky that my most important rule is not to get caught crossing the Overlord. I guess I will have to drop this matter for now.")
  303. Dialog.AddOption("I knew you would see it my way. Goodbye, Alucius.")
  304. Dialog.Start()
  305. end