VentarTKal.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/VentarTKal.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.03.21 01:03:05
  5. Script Purpose :
  6. :
  7. --]]
  8. local QUEST = 407 -- Ventar T'Kal quest
  9. local QUEST2 = 408 -- Orcs of the Ree quest
  10. local QUEST3 = 409 -- An Aquisition quest
  11. local QUEST4 = 410 -- Gifts from the Earth quest
  12. local QUEST5 = 411 -- The Skeleton Key quest
  13. local QUEST6 = 412 -- Returning to Captain Feralis quest
  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, QUEST) then
  20. ProvidesQuest(NPC, QUEST2)
  21. elseif HasCompletedQuest(Spawn, QUEST2) then
  22. ProvidesQuest(NPC, QUEST3)
  23. elseif HasCompletedQuest(Spawn, QUEST3) then
  24. ProvidesQuest(NPC, QUEST4)
  25. elseif HasCompletedQuest(Spawn, QUEST4) then
  26. ProvidesQuest(NPC, QUEST5)
  27. elseif HasCompletedQuest(Spawn, QUEST5) then
  28. ProvidesQuest(NPC, QUEST6)
  29. end
  30. end
  31. end
  32. function spawn(NPC)
  33. end
  34. function hailed(NPC, Spawn)
  35. FaceTarget(NPC, Spawn)
  36. if GetDeity(Spawn) ~= 1 then
  37. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1048.mp3", "", "", 0, 0, Spawn)
  38. if not HasQuest(Spawn, QUEST) and not HasCompletedQuest(Spawn, QUEST) or HasQuest(Spawn, QUEST6) or HasCompletedQuest(Spawn, QUEST6) then
  39. local choice = MakeRandomInt(1, 2)
  40. if choice == 1 then
  41. PlayFlavor(NPC, "", "Overlord protect us!", "", 1689589577, 4560189, Spawn)
  42. else
  43. PlayFlavor(NPC, "", "These nomads can be quite pleasant to deal with.", "", 1689589577, 4560189, Spawn)
  44. end
  45. end
  46. if HasQuest(Spawn, QUEST) and HasItem(Spawn, 14661) or HasCompletedQuest(Spawn, QUEST) and HasItem(Spawn, 14661) and not HasQuest(Spawn, QUEST2) and not HasCompletedQuest(Spawn, QUEST2) and not HasQuest(Spawn, QUEST3) and not HasCompletedQuest(Spawn, QUEST3) and not HasQuest(Spawn, QUEST4) and not HasCompletedQuest(Spawn, QUEST4) then
  47. local conversation = CreateConversation()
  48. AddConversationOption(conversation, "Yes. I have these roots for you.", "Option1")
  49. StartConversation(conversation, NPC, Spawn, "Are you "..GetName(Spawn).."?")
  50. elseif GetQuestStep(Spawn, QUEST2) == 1 or GetQuestStep(Spawn, QUEST2) == 2 then
  51. QUEST2_PROGRESS(NPC, Spawn)
  52. elseif GetQuestStep(Spawn, QUEST2) == 3 then
  53. QUEST2_FINISH(NPC, Spawn)
  54. elseif HasCompletedQuest(Spawn, QUEST2) and not HasQuest(Spawn, QUEST3) and not HasCompletedQuest(Spawn, QUEST3) then
  55. Option6(NPC, Spawn)
  56. elseif GetQuestStep(Spawn, QUEST3) == 1 or GetQuestStep(Spawn, QUEST3) == 2 then
  57. QUEST3_PROGRESS(NPC, Spawn)
  58. elseif GetQuestStep(Spawn, QUEST3) == 3 then
  59. QUEST3_FINISH(NPC, Spawn)
  60. elseif HasCompletedQuest(Spawn, QUEST2) and not HasQuest(Spawn, QUEST3) and HasCompletedQuest(Spawn, QUEST3) and not HasQuest(Spawn, QUEST4) and not HasCompletedQuest(Spawn, QUEST4) then
  61. Option11(NPC, Spawn)
  62. elseif GetQuestStep(Spawn, QUEST4) == 1 or GetQuestStep(Spawn, QUEST4) == 2 then
  63. QUEST4_PROGRESS(NPC, Spawn)
  64. elseif GetQuestStep(Spawn, QUEST4) == 3 then
  65. QUEST4_FINISH(NPC, Spawn)
  66. elseif HasCompletedQuest(Spawn, QUEST2) and not HasQuest(Spawn, QUEST3) and HasCompletedQuest(Spawn, QUEST3) and HasCompletedQuest(Spawn, QUEST4) and not HasQuest(Spawn, QUEST5) and not HasCompletedQuest(Spawn, QUEST5) then
  67. Option13(NPC, Spawn)
  68. elseif GetQuestStep(Spawn, QUEST5) == 1 or GetQuestStep(Spawn, QUEST5) == 2 or GetQuestStep(Spawn, QUEST5) == 3 or GetQuestStep(Spawn, QUEST5) == 4 or GetQuestStep(Spawn, QUEST5) == 5 then
  69. QUEST5_PROGRESS(NPC, Spawn)
  70. elseif GetQuestStep(Spawn, QUEST5) == 6 or HasCompletedQuest(Spawn, QUEST5) and not HasCompletedQuest(Spawn, QUEST6) and not HasQuest(Spawn, QUEST6) then
  71. QUEST5_FINISH(NPC, Spawn)
  72. end
  73. elseif GetDeity(Spawn) == 1 then
  74. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1048.mp3", "Don't talk to me", 0, 0, Spawn)
  75. end
  76. end
  77. function Option1(NPC, Spawn)
  78. if GetQuestStep(Spawn, QUEST) == 1 then
  79. SetStepComplete(Spawn, QUEST, 1)
  80. end
  81. FaceTarget(NPC, Spawn)
  82. local conversation = CreateConversation()
  83. AddConversationOption(conversation, "With what?", "Option2")
  84. StartConversation(conversation, NPC, Spawn, "Good, good. That means Feralis thinks you're able to help me.")
  85. end
  86. function Option2(NPC, Spawn)
  87. FaceTarget(NPC, Spawn)
  88. local conversation = CreateConversation()
  89. AddConversationOption(conversation, "Living and dead?", "Option3")
  90. StartConversation(conversation, NPC, Spawn, "The orcs of Ree, living and dead alike.")
  91. end
  92. function Option3(NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. local conversation = CreateConversation()
  95. AddConversationOption(conversation, "What do you need me to do?", "Option4")
  96. StartConversation(conversation, NPC, Spawn, "I don't know the specifics, but the orcs of Ree inhabit this land and so do their skeletons. Only recently, however, have the living emerged from the Wailing Caves. They are becoming bolder.")
  97. end
  98. function Option4(NPC, Spawn)
  99. FaceTarget(NPC, Spawn)
  100. local conversation = CreateConversation()
  101. AddConversationOption(conversation, "What is your intent?", "Option5")
  102. StartConversation(conversation, NPC, Spawn, "Poison them. When I heard of Rainus' roots I smelled an opportunity.")
  103. end
  104. function Option5(NPC, Spawn)
  105. FaceTarget(NPC, Spawn)
  106. local conversation = CreateConversation()
  107. AddConversationOption(conversation, "I can do this.", "offer")
  108. StartConversation(conversation, NPC, Spawn, "My intent is to get you to do work for me while I continue dealing with these nomads. What do I intend you to do on my behalf? I'd like you to travel west of here with the root, they have an encampment there. When you reach the orcs, place it near them. Let them consume it. From there I'm sure nature will take its course.")
  109. end
  110. function Option6(NPC, Spawn)
  111. FaceTarget(NPC, Spawn)
  112. local conversation = CreateConversation()
  113. AddConversationOption(conversation, "What do you mean?", "Option7")
  114. StartConversation(conversation, NPC, Spawn, "Interesting, quite interesting. I may have been wrong on their intentions.")
  115. end
  116. function Option7(NPC, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. local conversation = CreateConversation()
  119. AddConversationOption(conversation, "Why are they here?", "Option8")
  120. StartConversation(conversation, NPC, Spawn, "I had thought the Ree orcs to be attempting to expand outward from the Wailing Caves. That may still be their intent, but this specific group of orcs is not here for that reason.")
  121. end
  122. function Option8(NPC, Spawn)
  123. FaceTarget(NPC, Spawn)
  124. local conversation = CreateConversation()
  125. AddConversationOption(conversation, "What's in the box?", "Option9")
  126. StartConversation(conversation, NPC, Spawn, "Treasure hunting. Their orders are to seek out some sort of ancient Shin'Ree box. It appears one of their agents already had it in his possession. He buried it for safe keeping but was slain. However, it would seem he expected death and had word delivered to his people, though he didn't mention its exact location.")
  127. end
  128. function Option9(NPC, Spawn)
  129. FaceTarget(NPC, Spawn)
  130. local conversation = CreateConversation()
  131. AddConversationOption(conversation, "How can we get it?", "Option10")
  132. StartConversation(conversation, NPC, Spawn, "They list it simply as \"useful.\" I don't know what that means to the orcs specifically, but I would prefer they didn't have it. The orders mention a shipment landing at the Blackshield Docks. I imagine the shipment will lead us to this package before the orcs...")
  133. end
  134. function Option10(NPC, Spawn)
  135. FaceTarget(NPC, Spawn)
  136. local conversation = CreateConversation()
  137. AddConversationOption(conversation, "I will find him.", "offer2")
  138. StartConversation(conversation, NPC, Spawn, "Two ways, both involving the orc courier. I am not sure precisely how old these orders are, but the sooner we act the better. Find the runner of Ree. If he is on his way to the docks then kill him and take the shipping receipt. Use it to get the package from the docks. If you catch the runner on the way from the docks then he will have the shipment, in which case you can take it directly from him. He'll be somewhere between the Ree camp west of here and the docks.")
  139. end
  140. function Option11(NPC, Spawn)
  141. if GetQuestStep(Spawn, QUEST3) == 3 then
  142. SetStepComplete(Spawn, QUEST3, 3)
  143. end
  144. FaceTarget(NPC, Spawn)
  145. local conversation = CreateConversation()
  146. AddConversationOption(conversation, "...", "Option12")
  147. StartConversation(conversation, NPC, Spawn, "Excellent work. If I am right this will tell us where the orc buried this \'' useful \'' treasure. Give me a moment, please.")
  148. end
  149. function Option12(NPC, Spawn)
  150. FaceTarget(NPC, Spawn)
  151. local conversation = CreateConversation()
  152. AddConversationOption(conversation, "Ok.", "offer3")
  153. StartConversation(conversation, NPC, Spawn, "Perfect. It's somewhere near the Nektulous Station griffin tower, west of here. Go find it, dig it up, and bring it back to me.")
  154. end
  155. function Option13(NPC, Spawn)
  156. if GetQuestStep(Spawn, QUEST4) == 3 then
  157. SetStepComplete(Spawn, QUEST4, 3)
  158. end
  159. FaceTarget(NPC, Spawn)
  160. local conversation = CreateConversation()
  161. AddConversationOption(conversation, "I can get a bloody orc hand!", "Option14")
  162. AddConversationOption(conversation, "What can we do?", "Option15")
  163. StartConversation(conversation, NPC, Spawn, "Aye. I've read more of the Ree orders. This is an old relic from the Shin'Ree clan. Apparently the \''key\'' to opening it was, \''...a Shin'Ree orc with bloodied hand.\''")
  164. end
  165. function Option14(NPC, Spawn)
  166. FaceTarget(NPC, Spawn)
  167. local conversation = CreateConversation()
  168. AddConversationOption(conversation, "Well then what can we do?", "Option15")
  169. StartConversation(conversation, NPC, Spawn, "I'm afraid it's not that simple.")
  170. end
  171. function Option15(NPC, Spawn)
  172. FaceTarget(NPC, Spawn)
  173. local conversation = CreateConversation()
  174. AddConversationOption(conversation, "How?", "Option16")
  175. StartConversation(conversation, NPC, Spawn, "Well, orc magic is simplistic but it isn't something we can simply ignore. If the key to this chest is the bloodied hand of a Shin'Ree orc then that is what we must find. The skeletal orcs outside of the Wailing Caves are what's left of the Shin'Ree orcs. Among them you can find blood stained bones... which means hands. Unfortunately I doubt any of the skeletal orcs have preserved their bloody hands for us. But there is still a way.")
  176. end
  177. function Option16(NPC, Spawn)
  178. FaceTarget(NPC, Spawn)
  179. local conversation = CreateConversation()
  180. AddConversationOption(conversation, "I will bring you your fingers.", "offer4")
  181. StartConversation(conversation, NPC, Spawn, "We can build a bloody hand ourselves! Slay the Shin'Ree orcs. Among their fallen bones collect the bloodied fingers--enough to form a hand. That will fulfill the needs of this orc spell, I am certain.")
  182. end
  183. function Option17(NPC, Spawn)
  184. if GetQuestStep(Spawn, QUEST5) == 6 then
  185. SetStepComplete(Spawn, QUEST5, 6)
  186. end
  187. FaceTarget(NPC, Spawn)
  188. local conversation = CreateConversation()
  189. AddConversationOption(conversation, "Thanks.", "Option18")
  190. StartConversation(conversation, NPC, Spawn, "Good, good... Opening it should be as simple as... yes! A sash?... worthless. And under it? ...paper... The Code of the Shin'Ree? Useful? USEFUL? It's nothing but PAPER")
  191. end
  192. function Option18(NPC, Spawn)
  193. FaceTarget(NPC, Spawn)
  194. local conversation = CreateConversation()
  195. AddConversationOption(conversation, "Gee... thanks for telling me.", "Option19")
  196. AddConversationOption(conversation, "Alright.", "offer5")
  197. StartConversation(conversation, NPC, Spawn, "Yeah, yeah. Maybe next time we won't be so unlucky. Anyway, I neglected to mention this earlier--after all I wanted to get as much from you as I could--but Feralis has been asking for you. You should go speak with him, I believe he has another underling who could use your help.")
  198. end
  199. function Option19(NPC, Spawn)
  200. FaceTarget(NPC, Spawn)
  201. local conversation = CreateConversation()
  202. AddConversationOption(conversation, "Right.", "offer5")
  203. StartConversation(conversation, NPC, Spawn, "Push your advantages, "..GetName(Spawn).."...")
  204. end
  205. function offer(NPC, Spawn)
  206. FaceTarget(NPC, Spawn)
  207. OfferQuest(NPC, Spawn, QUEST2)
  208. end
  209. function offer2(NPC, Spawn)
  210. FaceTarget(NPC, Spawn)
  211. OfferQuest(NPC, Spawn, QUEST3)
  212. end
  213. function offer3(NPC, Spawn)
  214. FaceTarget(NPC, Spawn)
  215. OfferQuest(NPC, Spawn, QUEST4)
  216. end
  217. function offer4(NPC, Spawn)
  218. FaceTarget(NPC, Spawn)
  219. OfferQuest(NPC, Spawn, QUEST5)
  220. end
  221. function offer5(NPC, Spawn)
  222. FaceTarget(NPC, Spawn)
  223. OfferQuest(NPC, Spawn, QUEST6)
  224. end
  225. function QUEST2_PROGRESS(NPC, Spawn)
  226. FaceTarget(NPC, Spawn)
  227. local conversation = CreateConversation()
  228. AddConversationOption(conversation, "Not yet.")
  229. if not HasItem(Spawn, 46427) then
  230. AddConversationOption(conversation, "I need the treated frenzy root.", "root")
  231. end
  232. StartConversation(conversation, NPC, Spawn, "Is it done?")
  233. end
  234. function QUEST3_PROGRESS(NPC, Spawn)
  235. FaceTarget(NPC, Spawn)
  236. local conversation = CreateConversation()
  237. AddConversationOption(conversation, "Not yet.")
  238. StartConversation(conversation, NPC, Spawn, "Did you get the shipment?")
  239. end
  240. function QUEST3_FINISH(NPC, Spawn)
  241. FaceTarget(NPC, Spawn)
  242. local conversation = CreateConversation()
  243. AddConversationOption(conversation, "I did, here you go.", "Option11")
  244. StartConversation(conversation, NPC, Spawn, "Did you get the shipment?")
  245. end
  246. function QUEST2_FINISH(NPC, Spawn)
  247. FaceTarget(NPC, Spawn)
  248. SetStepComplete(Spawn, QUEST2, 3)
  249. local conversation = CreateConversation()
  250. AddConversationOption(conversation, "...", "Option6")
  251. StartConversation(conversation, NPC, Spawn, "Nice, very nice. Give me a moment while I read over these orders.")
  252. end
  253. function QUEST4_PROGRESS(NPC, Spawn)
  254. FaceTarget(NPC, Spawn)
  255. local conversation = CreateConversation()
  256. AddConversationOption(conversation, "Not yet.")
  257. StartConversation(conversation, NPC, Spawn, "Did you get it?")
  258. end
  259. function QUEST4_FINISH(NPC, Spawn)
  260. FaceTarget(NPC, Spawn)
  261. local conversation = CreateConversation()
  262. AddConversationOption(conversation, "I did. The buried chest is locked.", "Option13")
  263. StartConversation(conversation, NPC, Spawn, "Did you get it?")
  264. end
  265. function QUEST5_PROGRESS(NPC, Spawn)
  266. FaceTarget(NPC, Spawn)
  267. local conversation = CreateConversation()
  268. AddConversationOption(conversation, "Not yet.")
  269. StartConversation(conversation, NPC, Spawn, "Do you have the fingers?")
  270. end
  271. function QUEST5_FINISH(NPC, Spawn)
  272. FaceTarget(NPC, Spawn)
  273. local conversation = CreateConversation()
  274. AddConversationOption(conversation, "I do.", "Option17")
  275. StartConversation(conversation, NPC, Spawn, "Do you have the fingers?")
  276. end
  277. function root(NPC, Spawn)
  278. FaceTarget(NPC, Spawn)
  279. PlayFlavor(NPC, "", "Of course, here you are.", "", 0, 0, Spawn)
  280. AddItem(Spawn, 46427, 5)
  281. end
  282. function respawn(NPC)
  283. spawn(NPC)
  284. end