RainusCanton.lua 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/RainusCanton.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.02.27 12:02:54
  5. Script Purpose :
  6. :
  7. --]]
  8. local OrcsAndGhosts = 400 -- Orcs and Ghosts Quest
  9. local Rainus = 401 -- Rainus Quest
  10. local QUEST = 402 -- The Frenzy of the Bloodskulls Quest
  11. local QUEST2 = 403 -- Bloodskull Intention quest
  12. local QUEST3 = 404 -- Bloodskull Disruption Quest
  13. local QUEST4 = 405 -- Captain Feralis
  14. function spawn(NPC)
  15. SetPlayerProximityFunction(NPC, 10, "InRange")
  16. end
  17. function InRange(NPC, Spawn)
  18. if GetDeity(Spawn) ~= 1 then
  19. if HasCompletedQuest(Spawn, Rainus) then
  20. ProvidesQuest(NPC, QUEST)
  21. SetInfoFlag(NPC)
  22. SetVisualFlag(NPC)
  23. elseif HasCompletedQuest(Spawn, QUEST) then
  24. ProvidesQuest(NPC, QUEST2)
  25. SetInfoFlag(NPC)
  26. SetVisualFlag(NPC)
  27. elseif HasCompletedQuest(Spawn, QUEST2) then
  28. ProvidesQuest(NPC, QUEST3)
  29. SetInfoFlag(NPC)
  30. SetVisualFlag(NPC)
  31. elseif HasCompletedQuest(Spawn, QUEST3) then
  32. ProvidesQuest(NPC, QUEST4)
  33. SetInfoFlag(NPC)
  34. SetVisualFlag(NPC)
  35. end
  36. end
  37. end
  38. function hailed(NPC, Spawn)
  39. FaceTarget(NPC, Spawn)
  40. local choice = MakeRandomInt(1, 3)
  41. if choice == 1 then
  42. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1004.mp3", "", "", 0, 0, Spawn)
  43. elseif choice == 2 then
  44. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1004.mp3", "", "", 0, 0, Spawn)
  45. else
  46. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1004.mp3", "", "", 0, 0, Spawn)
  47. end
  48. if GetDeity(Spawn) ~= 1 then
  49. if not HasQuest(Spawn, QUEST) and not HasCompletedQuest(Spawn, QUEST) then
  50. if GetQuestStep(Spawn, Rainus) == 1 then
  51. SetStepComplete(Spawn, Rainus, 1)
  52. end
  53. FaceTarget(NPC, Spawn)
  54. local conversation = CreateConversation()
  55. AddConversationOption(conversation, " " .. GetName(Spawn) .. ", proudly enacting the will of the Overlord.", "Option1")
  56. AddConversationOption(conversation, " " .. GetName(Spawn) .. ", bound in service to none.", "Option1")
  57. AddConversationOption(conversation, " " .. GetName(Spawn) .. ", my loyalties remain private.", "Option1")
  58. StartConversation(conversation, NPC, Spawn, "Rainus Canton, a once wandering sword now bound in service to the Overlord. And yourself?")
  59. elseif GetQuestStep(Spawn, QUEST) == 1 or GetQuestStep(Spawn, QUEST) == 2 or GetQuestStep(Spawn, QUEST) == 3 then
  60. progress0(NPC, Spawn)
  61. elseif GetQuestStep(Spawn, QUEST) == 4 then
  62. progress1(NPC, Spawn)
  63. elseif HasCompletedQuest(Spawn, QUEST) and not HasCompletedQuest(Spawn, QUEST2) and not HasQuest(Spawn, QUEST2) then
  64. quest_complete1(NPC, Spawn)
  65. elseif GetQuestStep(Spawn, QUEST2) == 1 or GetQuestStep(Spawn, QUEST2) == 2 then
  66. quest2_progress0(NPC, Spawn)
  67. elseif GetQuestStep(Spawn, QUEST2) == 3 then
  68. quest2_progress1(NPC, Spawn)
  69. elseif GetQuestStep(Spawn, QUEST3) == 1 or GetQuestStep(Spawn, QUEST3) == 2 or GetQuestStep(Spawn, QUEST3) == 3 or GetQuestStep(Spawn, QUEST3) == 4 then
  70. quest3_progress0(NPC, Spawn)
  71. elseif GetQuestStep(Spawn, QUEST3) == 5 then
  72. quest3_progress1(NPC, Spawn)
  73. elseif HasCompletedQuest(Spawn, Rainus) and HasCompletedQuest(Spawn, QUEST) and HasCompletedQuest(Spawn, QUEST2) and not HasQuest(Spawn, QUEST3) and not HasCompletedQuest(Spawn, QUEST3) then
  74. Option9(NPC, Spawn)
  75. elseif HasCompletedQuest(Spawn, Rainus) and HasCompletedQuest(Spawn, QUEST) and HasCompletedQuest(Spawn, QUEST2) and HasCompletedQuest(Spawn, QUEST3) and not HasQuest(Spawn, QUEST4) and not HasCompletedQuest(Spawn, QUEST4) then
  76. Option16(NPC, Spawn)
  77. elseif HasCompletedQuest(Spawn, Rainus) and HasCompletedQuest(Spawn, QUEST) and HasCompletedQuest(Spawn, QUEST2) and HasCompletedQuest(Spawn, QUEST3) and HasQuest(Spawn, QUEST4) or HasCompletedQuest(Spawn, QUEST4) then
  78. PlayFlavor(NPC, "", "Your help did not go unappreciated, but i have nothing more to ask of you.", "", 0, 0, Spawn)
  79. elseif not HasQuest(Spawn, Rainus) and not HasCompletedQuest(Spawn, Rainus) then
  80. PlayFlavor(NPC, "", "Return when you're not so green", "hail", 0, 0, Spawn)
  81. end
  82. elseif GetDeity(Spawn) == 1 then
  83. PlayFlavor(NPC, "", "You know, the Overlord might hang me for talking to you.", "", 0, 0, Spawn)
  84. end
  85. end
  86. function progress0(NPC, Spawn)
  87. FaceTarget(NPC, Spawn)
  88. local conversation = CreateConversation()
  89. AddConversationOption(conversation, "Not yet.")
  90. StartConversation(conversation, NPC, Spawn, "Have you done as I asked?")
  91. end
  92. function progress1(NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. local conversation = CreateConversation()
  95. AddConversationOption(conversation, "I have, here are the root samples.", "quest_complete1")
  96. StartConversation(conversation, NPC, Spawn, "Have you done as I asked?")
  97. end
  98. function quest2_progress0(NPC, Spawn)
  99. FaceTarget(NPC, Spawn)
  100. local conversation = CreateConversation()
  101. AddConversationOption(conversation, "Not yet.")
  102. StartConversation(conversation, NPC, Spawn, "Did you slay the orcs and get the orders?")
  103. end
  104. function quest2_progress1(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. local conversation = CreateConversation()
  107. AddConversationOption(conversation, "I did. Here you go.", "Option9")
  108. StartConversation(conversation, NPC, Spawn, "Did you slay the orcs and get the orders?")
  109. end
  110. function quest3_progress0(NPC, Spawn)
  111. FaceTarget(NPC, Spawn)
  112. local conversation = CreateConversation()
  113. AddConversationOption(conversation, "I'll return when it's done.")
  114. StartConversation(conversation, NPC, Spawn, "The orcs?")
  115. end
  116. function quest3_progress1(NPC, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. local conversation = CreateConversation()
  119. AddConversationOption(conversation, "Taken care of.", "Option14")
  120. StartConversation(conversation, NPC, Spawn, "The orcs?")
  121. end
  122. function quest_complete1(NPC, Spawn)
  123. if GetQuestStep(Spawn, QUEST) == 4 then
  124. SetStepComplete(Spawn, QUEST, 4)
  125. end
  126. FaceTarget(NPC, Spawn)
  127. local conversation = CreateConversation()
  128. AddConversationOption(conversation, "You mentioned having more work for me.", "Option8")
  129. StartConversation(conversation, NPC, Spawn, "Good work, " .. GetName(Spawn) .. ". I'll get these to our alchemist for study.")
  130. end
  131. function Option1(NPC, Spawn)
  132. FaceTarget(NPC, Spawn)
  133. local conversation = CreateConversation()
  134. AddConversationOption(conversation, "My business is my own.", "Option2")
  135. AddConversationOption(conversation, "No, I am not.", "Option2")
  136. AddConversationOption(conversation, "I am.", "Option3")
  137. StartConversation(conversation, NPC, Spawn, " " .. GetName(Spawn) .. ", indeed. Your name has graced the lips of many I have had the fortune--or misfortune--to listen to. It is a, ehm--a pleasure to meet you. Are you out here in the service of the Overlord as well?")
  138. end
  139. function Option2(NPC, Spawn)
  140. FaceTarget(NPC, Spawn)
  141. local conversation = CreateConversation()
  142. AddConversationOption(conversation, "How?", "Option4")
  143. AddConversationOption(conversation, "Not today.")
  144. StartConversation(conversation, NPC, Spawn, "Well, that is why I am here, anyway. If you would care to help, then you may join me in earning his favor.")
  145. end
  146. function Option3(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. local conversation = CreateConversation()
  149. AddConversationOption(conversation, "How?", "Option4")
  150. AddConversationOption(conversation, "Not today.")
  151. StartConversation(conversation, NPC, Spawn, "Splendid. Perhaps you would care to join me in earning his favor.")
  152. end
  153. function Option4(NPC, Spawn)
  154. FaceTarget(NPC, Spawn)
  155. local conversation = CreateConversation()
  156. AddConversationOption(conversation, "And what are you doing?", "Option5")
  157. StartConversation(conversation, NPC, Spawn, "Captain Feralis has been tasked with re-confirming the orc threat to Freeport. No, that doesn't mean we fear they could ever bring the city down, but even a gnat can annoy and pester. Feralis has asked me to help him, and I have agreed.")
  158. end
  159. function Option5(NPC, Spawn)
  160. FaceTarget(NPC, Spawn)
  161. local conversation = CreateConversation()
  162. AddConversationOption(conversation, "Reliance on a root?", "Option6")
  163. StartConversation(conversation, NPC, Spawn, "Harassing the Bloodskulls, of course! And in doing so learning of their strengths and weaknesses. I've found them typical, so far. But one thing does stand out, their reliance on a thick root that grows around here.")
  164. end
  165. function Option6(NPC, Spawn)
  166. FaceTarget(NPC, Spawn)
  167. local conversation = CreateConversation()
  168. AddConversationOption(conversation, "What can I do?", "Option7")
  169. StartConversation(conversation, NPC, Spawn, "Bloodskull Frenzy Root. The Bloodskull shamans provide their orcs with a solution that combines with the root to create an elixir that sends the orcs into a rage once they're in combat. All the tests we've run on the weed have so far turned up nothing and we've run out of samples. Care to lend a hand?")
  170. end
  171. function Option7(NPC, Spawn)
  172. FaceTarget(NPC, Spawn)
  173. local conversation = CreateConversation()
  174. AddConversationOption(conversation, "All right.", "offer")
  175. StartConversation(conversation, NPC, Spawn, "Head west of here. Once you find the orcs, pay your respects to the Overlord: kill some of the Bloodskull warriors and priests. However, and this is the important part, I would also like some samples of the Frenzy Root. The shaman mixture we have, don't worry about that, but bring me at least five root samples.")
  176. end
  177. function Option8(NPC, Spawn)
  178. FaceTarget(NPC, Spawn)
  179. local conversation = CreateConversation()
  180. AddConversationOption(conversation, "All right.", "offer2")
  181. StartConversation(conversation, NPC, Spawn, "That's right. I believe the orcs in this region are acting without new orders, they seem to be somewhat stagnant, or at the very least slow. They either have an inept leader or an absent one. I'd like you to head to the ruined towers west of here. There are some Bloodskull tower guards, kill them and search the corpses for the standing orders for these Bloodskull orcs. I'd like to see what they're working toward, if anything.")
  182. end
  183. function Option9(NPC, Spawn)
  184. FaceTarget(NPC, Spawn)
  185. if HasQuest(Spawn, QUEST2) then
  186. SetStepComplete(Spawn, QUEST2, 3)
  187. end
  188. local conversation = CreateConversation()
  189. AddConversationOption(conversation, "What do the orders say?", "Option10")
  190. StartConversation(conversation, NPC, Spawn, "Wonderful. Unfortunately we still don't have any word on the root.")
  191. end
  192. function Option10(NPC, Spawn)
  193. FaceTarget(NPC, Spawn)
  194. local conversation = CreateConversation()
  195. AddConversationOption(conversation, "...", "Option11")
  196. StartConversation(conversation, NPC, Spawn, "Give me a moment, the orcs aren't known for their grammar.")
  197. end
  198. function Option11(NPC, Spawn)
  199. FaceTarget(NPC, Spawn)
  200. local conversation = CreateConversation()
  201. AddConversationOption(conversation, "What for?", "Option12")
  202. StartConversation(conversation, NPC, Spawn, "It looks like these are orders to build up a ''cha nu durk.'' Which is--I think--the minimum size of a orc fighting unit.")
  203. end
  204. function Option12(NPC, Spawn)
  205. FaceTarget(NPC, Spawn)
  206. local conversation = CreateConversation()
  207. AddConversationOption(conversation, "What?", "Option13")
  208. StartConversation(conversation, NPC, Spawn, "Carnage, no doubt. Orcs always wear their hearts upon their sleeves. The only thing a force that small would be useful for is routing civilians... Maybe a hit and run force for the Crossroads... ah hah!")
  209. end
  210. function Option13(NPC, Spawn)
  211. FaceTarget(NPC, Spawn)
  212. local conversation = CreateConversation()
  213. AddConversationOption(conversation, "A siege tower?", "offer3")
  214. StartConversation(conversation, NPC, Spawn, "I read the orcs as books. They've two camps south-west of the Crossroads, just south of the kerran and ratonga villages. The orcs of these two camps will likely make up the cha nu durk... Kill the orcs and destroy their supplies. If they have a siege tower, destroy it as well.")
  215. end
  216. function Option14(NPC, Spawn)
  217. FaceTarget(NPC, Spawn)
  218. local conversation = CreateConversation()
  219. SetStepComplete(Spawn, QUEST3, 5)
  220. AddConversationOption(conversation, "What did you discover?", "Option15")
  221. StartConversation(conversation, NPC, Spawn, "Wonderful job, "..GetName(Spawn).." The orcs will be feeling this for a while. In theory we could harry them endlessly if their leader never returned. That would make an interesting study to return home with. Speaking of that, I got word back on the orc roots.")
  222. end
  223. function Option15(NPC, Spawn)
  224. FaceTarget(NPC, Spawn)
  225. local conversation = CreateConversation()
  226. AddConversationOption(conversation, "Perfect?", "Option16")
  227. StartConversation(conversation, NPC, Spawn, "That the orcs are more stupid than we thought. The elixir they create is triggered whenever the orc's adrenaline gets high enough. When this happens it actually eats away at the orc's brain! This damages the orc permanently. This is, of course, perfect.")
  228. end
  229. function Option16(NPC, Spawn)
  230. FaceTarget(NPC, Spawn)
  231. local conversation = CreateConversation()
  232. AddConversationOption(conversation, "I can do that.", "offer4")
  233. StartConversation(conversation, NPC, Spawn, "If it's good enough for one clan of orcs why not others? I'd like you to deliver some of these treated roots to Captain Feralis at the Crossroads for me.")
  234. end
  235. function offer4(NPC, Spawn)
  236. FaceTarget(NPC, Spawn)
  237. OfferQuest(NPC, Spawn, QUEST4)
  238. end
  239. function offer3(NPC, Spawn)
  240. FaceTarget(NPC, Spawn)
  241. OfferQuest(NPC, Spawn, QUEST3)
  242. end
  243. function offer2(NPC, Spawn)
  244. FaceTarget(NPC, Spawn)
  245. OfferQuest(NPC, Spawn, QUEST2)
  246. end
  247. function offer(NPC, Spawn)
  248. FaceTarget(NPC, Spawn)
  249. OfferQuest(NPC, Spawn, QUEST)
  250. end
  251. function respawn(NPC)
  252. spawn(NPC)
  253. end