9
3

CaptainVertas.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/CaptainVertas.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.01.03 01:01:54
  5. Script Purpose :
  6. :
  7. --]]
  8. local FinishingtheNegotiations = 425
  9. local TroubleAbout = 441
  10. local MoreThenMeetsTheEye = 442
  11. local ProvingYourWorth = 443
  12. local ConfusionIsTheKey = 444
  13. local OneFinalTask = 445
  14. function spawn(NPC)
  15. SetPlayerProximityFunction(NPC, 10, "InRange")
  16. end
  17. function InRange(NPC, Spawn)
  18. if not HasQuest(Spawn, FinishingtheNegotiations) and not HasCompletedQuest(Spawn, FinishingtheNegotiations) then
  19. ProvidesQuest(NPC, FinishingtheNegotiations)
  20. SetInfoFlag(NPC)
  21. SetVisualFlag(NPC)
  22. elseif HasCompletedQuest(Spawn, FinishingtheNegotiations) then
  23. ProvidesQuest(NPC, TroubleAbout)
  24. SetInfoFlag(NPC)
  25. SetVisualFlag(NPC)
  26. elseif HasCompletedQuest(Spawn, TroubleAbout) then
  27. ProvidesQuest(NPC, MoreThenMeetsTheEye)
  28. SetInfoFlag(NPC)
  29. SetVisualFlag(NPC)
  30. elseif HasCompletedQuest(Spawn, MoreThenMeetsTheEye) then
  31. ProvidesQuest(NPC, ProvingYourWorth)
  32. SetInfoFlag(NPC)
  33. SetVisualFlag(NPC)
  34. elseif HasCompletedQuest(Spawn, ProvingYourWorth) then
  35. ProvidesQuest(NPC, ConfusionIsTheKey)
  36. SetInfoFlag(NPC)
  37. SetVisualFlag(NPC)
  38. elseif HasCompletedQuest(Spawn, ConfusionIsTheKey) then
  39. ProvidesQuest(NPC, OneFinalTask)
  40. SetInfoFlag(NPC)
  41. SetVisualFlag(NPC)
  42. end
  43. end
  44. function hailed(NPC, Spawn)
  45. FaceTarget(NPC, Spawn)
  46. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3", "", "", 0, 0, Spawn)
  47. if GetQuestStep(Spawn, FinishingtheNegotiations) == 1 then
  48. SetStepComplete(Spawn, FinishingtheNegotiations, 1)
  49. end
  50. if not HasQuest(Spawn, TroubleAbout) and not HasCompletedQuest(Spawn, TroubleAbout) then
  51. Option1(NPC, Spawn)
  52. elseif HasCompletedQuest(Spawn, TroubleAbout) and not HasCompletedQuest(Spawn, MoreThenMeetsTheEye) then
  53. Option6(NPC, Spawn)
  54. elseif GetQuestStep(Spawn, TroubleAbout) == 1 or GetQuestStep(Spawn, MoreThenMeetsTheEye) == 1 or GetQuestStep(Spawn, ProvingYourWorth) == 1 or GetQuestStep(Spawn, ProvingYourWorth) == 2 or GetQuestStep(Spawn, ProvingYourWorth) == 3 or GetQuestStep(Spawn, ProvingYourWorth) == 4 or GetQuestStep(Spawn, ConfusionIsTheKey) == 1 or GetQuestStep(Spawn, OneFinalTask) == 1 then
  55. QuestProgress(NPC, Spawn)
  56. elseif GetQuestStep(Spawn, TroubleAbout) == 2 or GetQuestStep(Spawn, MoreThenMeetsTheEye) == 2 or GetQuestStep(Spawn, ProvingYourWorth) == 5 or GetQuestStep(Spawn, ConfusionIsTheKey) == 2 or GetQuestStep(Spawn, OneFinalTask) == 2 then
  57. QuestFinish(NPC, Spawn)
  58. elseif HasCompletedQuest(Spawn, TroubleAbout) and HasCompletedQuest(Spawn, MoreThenMeetsTheEye) and not HasCompletedQuest(Spawn, ProvingYourWorth) then
  59. Option10(NPC, Spawn)
  60. elseif HasCompletedQuest(Spawn, TroubleAbout) and HasCompletedQuest(Spawn, MoreThenMeetsTheEye) and HasCompletedQuest(Spawn, ProvingYourWorth) and not HasCompletedQuest(Spawn, ConfusionIsTheKey) then
  61. Option15(NPC, Spawn)
  62. elseif HasCompletedQuest(Spawn, TroubleAbout) and HasCompletedQuest(Spawn, MoreThenMeetsTheEye) and HasCompletedQuest(Spawn, ProvingYourWorth) and HasCompletedQuest(Spawn, ConfusionIsTheKey) and not HasCompletedQuest(Spawn, OneFinalTask) then
  63. Option19(NPC, Spawn)
  64. elseif HasCompletedQuest(Spawn, TroubleAbout) and HasCompletedQuest(Spawn, MoreThenMeetsTheEye) and HasCompletedQuest(Spawn, ProvingYourWorth) and HasCompletedQuest(Spawn, ConfusionIsTheKey) and HasCompletedQuest(Spawn, OneFinalTask) then
  65. PlayFlavor(NPC, "", "Hail, good to see you again soldier!", "salute", 0, 0, Spawn)
  66. end
  67. end
  68. function Option1(NPC, Spawn)
  69. conversation = CreateConversation()
  70. AddConversationOption(conversation, "What does the job pay?", "Option2")
  71. AddConversationOption(conversation, "No, I don't have time right now.")
  72. StartConversation(conversation, NPC, Spawn, "Pah, the orcs and the dervish... Listen, the Freeport Militia requires your help. Will you do a service for the Militia?")
  73. end
  74. function Option2(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. local conversation = CreateConversation()
  77. AddConversationOption(conversation, "Whatever. I'll work for you. Getting paid is nice, though", "Option3")
  78. AddConversationOption(conversation, "Right, I'll be on my way.")
  79. StartConversation(conversation, NPC, Spawn, "Pay... PAY? You insolent pig, you should be bowing down at my feet asking me for forgiveness. You ought to be paying homage to the Overlord for all he has given you!")
  80. end
  81. function Option3(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. local conversation = CreateConversation()
  84. AddConversationOption(conversation, "What will I do when I find him?", "Option4")
  85. AddConversationOption(conversation, "Find someone else. I don't have time.")
  86. StartConversation(conversation, NPC, Spawn, "You will be compensated for your time. There have been reports of a growing threat in the Commonlands. The militia requires you to travel to the west to the road beyond the druid ring to find the orc emissary. Our reports tell us the emissary is the one who is passing stolen information to the Deathfist Empire.")
  87. end
  88. function Option4(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. local conversation = CreateConversation()
  91. AddConversationOption(conversation, "I will serve the Overlord.", "offer")
  92. AddConversationOption(conversation, "Maybe later.")
  93. StartConversation(conversation, NPC, Spawn, "Deal with him by any means necessary! Bring back to me any evidence you may find.")
  94. end
  95. function Option5(NPC, Spawn)
  96. SetStepComplete(Spawn, TroubleAbout, 2)
  97. FaceTarget(NPC, Spawn)
  98. local conversation = CreateConversation()
  99. AddConversationOption(conversation, "Just doing my part for the Overlord.")
  100. StartConversation(conversation, NPC, Spawn, "Note? Indeed, this is interesting. You were right to bring this to me. Well done, soldier.")
  101. end
  102. function Option6(NPC, Spawn)
  103. FaceTarget(NPC, Spawn)
  104. local conversation = CreateConversation()
  105. AddConversationOption(conversation, "No, sir, I did not.", "Option7")
  106. AddConversationOption(conversation, "Yes, I showed it to everyone. May I go now?")
  107. StartConversation(conversation, NPC, Spawn, "This note you brought me provided us with some good information. Did you show it to anyone else?")
  108. end
  109. function Option7(NPC, Spawn)
  110. FaceTarget(NPC, Spawn)
  111. local conversation = CreateConversation()
  112. AddConversationOption(conversation, "No, sir, I am not.", "Option8")
  113. AddConversationOption(conversation, "Nope. I don't have time for this.")
  114. StartConversation(conversation, NPC, Spawn, "Good. Very good to hear. Careful, kid, the dervishes have spies everywhere. Whatever you do, do not trust anyone because they might be a spy. Just last week, we had to put two people to death because we suspected them of being spies. Are you sure you're not a spy?")
  115. end
  116. function Option8(NPC, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. local conversation = CreateConversation()
  119. AddConversationOption(conversation, "Yes, sir. I will go now.", "offer2")
  120. AddConversationOption(conversation, "Maybe another time.")
  121. StartConversation(conversation, NPC, Spawn, "I guess not. You don't look like a spy. A spy wouldn't look so foolish. I need you to go scout out the dervish camps in the southwest area of The Commonlands. The note says they've set up camp in that area. Go there now and investigate it.")
  122. end
  123. function Option9(NPC, Spawn)
  124. SetStepComplete(Spawn, MoreThenMeetsTheEye, 2)
  125. FaceTarget(NPC, Spawn)
  126. local conversation = CreateConversation()
  127. AddConversationOption(conversation, "Thanks, Captain.")
  128. StartConversation(conversation, NPC, Spawn, "I knew it! Excellent work, soldier. You have earned your first insignia. If you keep up the good work, you just might make something of yourself.")
  129. end
  130. function Option10(NPC, Spawn)
  131. FaceTarget(NPC, Spawn)
  132. local conversation = CreateConversation()
  133. AddConversationOption(conversation, "Prove my worth?", "Option11")
  134. AddConversationOption(conversation, "I have nothing to prove to you!")
  135. StartConversation(conversation, NPC, Spawn, "Oh good, you've returned. Thank you for the information you have gathered. You seem trustworthy, but you will now need to prove your worth to the Militia and to the Overlord of Freeport.")
  136. end
  137. function Option11(NPC, Spawn)
  138. FaceTarget(NPC, Spawn)
  139. local conversation = CreateConversation()
  140. AddConversationOption(conversation, "I'm worthy, and I'll prove it.", "Option12")
  141. AddConversationOption(conversation, "I don't like your attitude. Bye!")
  142. StartConversation(conversation, NPC, Spawn, "Yes, it is time you prove your worth to me... err... to Freeport and to the Overlord. Stop asking so many questions! I have a special mission for you.")
  143. end
  144. function Option12(NPC, Spawn)
  145. FaceTarget(NPC, Spawn)
  146. local conversation = CreateConversation()
  147. AddConversationOption(conversation, "Ah, yes. About time we got back to the killing.", "Option13")
  148. AddConversationOption(conversation, "I'm sorry, but I have a prior engagement.")
  149. StartConversation(conversation, NPC, Spawn, "Good to hear. That is the attitude we want to see in young recruits. I need you to travel back to the camp to the west. There you will need to remove some of the dervishes from the land of the living. ")
  150. end
  151. function Option13(NPC, Spawn)
  152. FaceTarget(NPC, Spawn)
  153. local conversation = CreateConversation()
  154. AddConversationOption(conversation, "I will do my best.", "offer3")
  155. StartConversation(conversation, NPC, Spawn, "Let me give you a list. Make sure to crush them thoroughly. Dervish heretics, outlanders, cutthroats, and thaumaturges. Go now! Hurry back.")
  156. end
  157. function Option14(NPC, Spawn)
  158. SetStepComplete(Spawn, ProvingYourWorth, 5)
  159. FaceTarget(NPC, Spawn)
  160. local conversation = CreateConversation()
  161. AddConversationOption(conversation, "Thanks for the compliment, I guess")
  162. StartConversation(conversation, NPC, Spawn, "Really? Well, you may not be as useless as I first thought.")
  163. end
  164. function Option15(NPC, Spawn)
  165. FaceTarget(NPC, Spawn)
  166. local conversation = CreateConversation()
  167. AddConversationOption(conversation, "That sounds amusing.", "Option16")
  168. AddConversationOption(conversation, "I am not a spy. Go get someone else.")
  169. StartConversation(conversation, NPC, Spawn, "For one so young, you have done well thus far. I still have more for you to do before I can let you go. Are you up to some undercover work?")
  170. end
  171. function Option16(NPC, Spawn)
  172. FaceTarget(NPC, Spawn)
  173. local conversation = CreateConversation()
  174. AddConversationOption(conversation, "Kid? You're pushing it, Vertas.", "Option17")
  175. AddConversationOption(conversation, "I don't have time for this.")
  176. StartConversation(conversation, NPC, Spawn, "I like you, kid. What I need you to do is travel to their forward command camp and infiltrate their defenses. You will take this set of orders and switch them for their current list of orders.")
  177. end
  178. function Option17(NPC, Spawn)
  179. FaceTarget(NPC, Spawn)
  180. local conversation = CreateConversation()
  181. AddConversationOption(conversation, "Just give me the orders already.", "offer4")
  182. AddConversationOption(conversation, "No, not this time. Bye!")
  183. StartConversation(conversation, NPC, Spawn, "Oh, sorry sport. Will you take this mission or not? It will be dangerous. Something I'm sure is right up your alley. If it's not, well... we'll have to send the medics, I guess.")
  184. end
  185. function Option18(NPC, Spawn)
  186. SetStepComplete(Spawn, ConfusionIsTheKey, 2)
  187. FaceTarget(NPC, Spawn)
  188. local conversation = CreateConversation()
  189. AddConversationOption(conversation, "Thanks, Captain!")
  190. StartConversation(conversation, NPC, Spawn, "Very well done. Impressive, in fact. You have earned another rank on your insignia.")
  191. end
  192. function Option19(NPC, Spawn)
  193. FaceTarget(NPC, Spawn)
  194. local conversation = CreateConversation()
  195. AddConversationOption(conversation, "That's good to hear.", "Option20")
  196. AddConversationOption(conversation, "Yeah, okay. I'll be on my way.")
  197. StartConversation(conversation, NPC, Spawn, "You've done well up to this point, cadet. The information you have gathered so far has helped our cause. Now it's time I give you a real mission.")
  198. end
  199. function Option20(NPC, Spawn)
  200. FaceTarget(NPC, Spawn)
  201. local conversation = CreateConversation()
  202. AddConversationOption(conversation, "Okay. Who is my target?", "Option21")
  203. AddConversationOption(conversation, "Get someone else.")
  204. StartConversation(conversation, NPC, Spawn, "You are now required to perform an important task for the Militia. Because of the fake orders you delivered, we were able to pinpoint the highest ranking officer in this regiment. Now, you must go and eliminate him.")
  205. end
  206. function Option21(NPC, Spawn)
  207. FaceTarget(NPC, Spawn)
  208. local conversation = CreateConversation()
  209. AddConversationOption(conversation, "Affirmative, sir.", "offer5")
  210. AddConversationOption(conversation, "Sounds like you should tighten security.")
  211. StartConversation(conversation, NPC, Spawn, "Shh... Not so loud! I'll whisper it to you. This type of information we do not speak in open areas. You never know who is listening. One spy hearing the wrong bit of information can ruin just about everything.")
  212. end
  213. function Option22(NPC, Spawn)
  214. SetStepComplete(Spawn, OneFinalTask, 2)
  215. FaceTarget(NPC, Spawn)
  216. local conversation = CreateConversation()
  217. AddConversationOption(conversation, "I will wear it with pride, sir.")
  218. StartConversation(conversation, NPC, Spawn, "I knew you had it in you, soldier. You have earned my highest respect. Take this insignia and wear it proudly as a symbol of your bravery as a member of the Militia.")
  219. end
  220. function offer(NPC, Spawn)
  221. OfferQuest(NPC, Spawn, TroubleAbout)
  222. end
  223. function offer2(NPC, Spawn)
  224. OfferQuest(NPC, Spawn, MoreThenMeetsTheEye)
  225. end
  226. function offer3(NPC, Spawn)
  227. OfferQuest(NPC, Spawn, ProvingYourWorth)
  228. end
  229. function offer4(NPC, Spawn)
  230. OfferQuest(NPC, Spawn, ConfusionIsTheKey)
  231. end
  232. function offer5(NPC, Spawn)
  233. OfferQuest(NPC, Spawn, OneFinalTask)
  234. end
  235. function QuestProgress(NPC, Spawn)
  236. FaceTarget(NPC, Spawn)
  237. local conversation = CreateConversation()
  238. AddConversationOption(conversation, "Slime?")
  239. StartConversation(conversation, NPC, Spawn, "Nothing to see here, move along! Be on your way slime!")
  240. end
  241. function QuestFinish(NPC, Spawn)
  242. FaceTarget(NPC, Spawn)
  243. local conversation = CreateConversation()
  244. if GetQuestStep(Spawn, TroubleAbout) == 2 then
  245. AddConversationOption(conversation, "I killed the emissary and he had this note on him. I thought you might find it interesting.", "Option5")
  246. elseif GetQuestStep(Spawn, MoreThenMeetsTheEye) == 2 then
  247. AddConversationOption(conversation, "I scouted the dervish camp, as you asked.", "Option9")
  248. elseif GetQuestStep(Spawn, ProvingYourWorth) == 5 then
  249. AddConversationOption(conversation, "I have removed some of the dervish insurgents, as you asked.", "Option14")
  250. elseif GetQuestStep(Spawn, ConfusionIsTheKey) == 2 then
  251. AddConversationOption(conversation, "I was able to switch the orders.", "Option18")
  252. elseif GetQuestStep(Spawn, OneFinalTask) == 2 then
  253. AddConversationOption(conversation, "Ralio has been eliminated, sir.", "Option22")
  254. end
  255. AddConversationOption(conversation, "Nothing right now.")
  256. StartConversation(conversation, NPC, Spawn, "Hail. What have you to report?")
  257. end
  258. function respawn(NPC)
  259. end