TeceraValnos.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/TeceraValnos.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.12 09:05:26
  5. Script Purpose :
  6. Script Notes : Added movement
  7. --]]
  8. QUEST = 414 -- Tesera Valnos Quest
  9. QUEST2 = 415 -- Broken Equipment Quest
  10. QUEST3 = 413 -- The Bloodskull Threat Quest
  11. QUEST4 = 5221 -- Returning to Captain Feralis(Final Quest)
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 10, "InRange")
  14. MovementLoopAddLocation(NPC, 563.48, -42.51, 696.01, 2, 10)
  15. MovementLoopAddLocation(NPC, 589.12, -47.48, 686.90, 2, 10)
  16. MovementLoopAddLocation(NPC, 573.82, -43.50, 682.51, 2, 10)
  17. MovementLoopAddLocation(NPC, 573.94, -43.60, 683.56, 2, 10)
  18. MovementLoopAddLocation(NPC, 566.29, -42.44, 688.84, 2, 10)
  19. MovementLoopAddLocation(NPC, 582.57, -46.43, 692.85, 2, 10)
  20. MovementLoopAddLocation(NPC, 575.42, -46.81, 717.76, 2, 10)
  21. MovementLoopAddLocation(NPC, 577.93, -47.27, 719.13, 2, 10)
  22. MovementLoopAddLocation(NPC, 580.85, -45.08, 684.22, 2, 10)
  23. MovementLoopAddLocation(NPC, 570.90, -46.07, 717.06, 2, 10)
  24. MovementLoopAddLocation(NPC, 577.86, -45.04, 691.07, 2, 10)
  25. end
  26. function InRange(NPC, Spawn)
  27. if GetDeity(Spawn) ~= 1 then
  28. if not HasCompletedQuest(Spawn, QUEST) then
  29. ProvidesQuest(NPC, QUEST2)
  30. SetInfoFlag(NPC)
  31. SetVisualFlag(NPC)
  32. elseif HasCompletedQuest(Spawn, QUEST2) then
  33. ProvidesQuest(NPC, QUEST3)
  34. SetInfoFlag(NPC)
  35. SetVisualFlag(NPC)
  36. elseif HasCompletedQuest(Spawn, QUEST3) then
  37. ProvidesQuest(NPC, QUEST4)
  38. SetInfoFlag(NPC)
  39. SetVisualFlag(NPC)
  40. end
  41. end
  42. end
  43. function hailed(NPC, Spawn)
  44. FaceTarget(NPC, Spawn)
  45. if HasQuest(Spawn, QUEST) or HasCompletedQuest(Spawn, QUEST) and not HasQuest(Spawn, QUEST2) and not HasCompletedQuest(Spawn, QUEST2) and not HasCompletedQuest(Spawn, QUEST3) and not HasCompletedQuest(Spawn, QUEST4) then
  46. local conversation = CreateConversation()
  47. AddConversationOption(conversation, "I am "..GetName(Spawn)..". Feralis sent me to offer my help.", "Option1")
  48. StartConversation(conversation, NPC, Spawn, "Make it quick, I am quite busy.")
  49. elseif GetQuestStep(Spawn, QUEST2) < 8 and not HasCompletedQuest(Spawn, QUEST2) then
  50. QUEST2_PROGRESS(NPC, Spawn)
  51. elseif GetQuestStep(Spawn, QUEST2) == 8 or HasCompletedQuest(Spawn, QUEST2) and not HasQuest(Spawn, QUEST3) and not HasCompletedQuest(Spawn, QUEST3) then
  52. QUEST2_FINISH(NPC, Spawn)
  53. elseif GetQuestStep(Spawn, QUEST3) < 5 and not HasCompletedQuest(Spawn, QUEST3) then
  54. QUEST3_PROGRESS(NPC, Spawn)
  55. elseif GetQuestStep(Spawn, QUEST3) == 5 or HasCompletedQuest(Spawn, QUEST3) and not HasQuest(Spawn, QUEST4) and not HasCompletedQuest(Spawn, QUEST4) then
  56. QUEST3_FINISH(NPC, Spawn)
  57. elseif HasCompletedQuest(Spawn, QUEST) and HasCompletedQuest(Spawn, QUEST2) and HasCompletedQuest(Spawn, QUEST3) and HasQuest(Spawn, QUEST4) or HasCompletedQuest(Spawn, QUEST4) then
  58. PlayFlavor(NPC, "", "Thank you, friend.", "salute", 0, 0, Spawn)
  59. elseif not HasQuest(Spawn, QUEST) and not HasCompletedQuest(Spawn, QUEST) 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
  60. PlayFlavor(NPC, "", "Talk to me later. once you've got your priorities sorted out.", "", 0, 0, Spawn)
  61. end
  62. end
  63. function Option1(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. if HasQuest(Spawn, QUEST) then
  66. SetStepComplete(Spawn, QUEST, 1)
  67. end
  68. local conversation = CreateConversation()
  69. AddConversationOption(conversation, "What business?", "Option2")
  70. StartConversation(conversation, NPC, Spawn, "It's about time he sent help. I've nearly lost the band of Bloodskulls I'm tracking and now this business with the Ruins of Val'marr.")
  71. end
  72. function Option2(NPC, Spawn)
  73. FaceTarget(NPC, Spawn)
  74. local conversation = CreateConversation()
  75. AddConversationOption(conversation, "Why?", "Option3")
  76. StartConversation(conversation, NPC, Spawn, "We got new orders a while back. We were to keep a close watch on the undead north of here. So we started to watch. So far... nothing, yet we continue to waste resources.")
  77. end
  78. function Option3(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. local conversation = CreateConversation()
  81. AddConversationOption(conversation, "What can I do to help?", "Option4")
  82. StartConversation(conversation, NPC, Spawn, "It is not our job to question our orders, only to follow them. In dealing with these undead we set up some arcanic sentries about the ruins. Now those have been disabled and we're left with far less than what we started with. Meanwhile I'm working hard to keep my scouts on top of the Bloodskulls we had been tracking before. Needless to say things are hectic around here.")
  83. end
  84. function Option4(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. local conversation = CreateConversation()
  87. AddConversationOption(conversation, "How can they be repaired?", "Option5")
  88. StartConversation(conversation, NPC, Spawn, "That's what I like to hear! We need the arcanic sentries back in action. The undead are too stupid to have taken them out--perhaps that's why our superiors are so interested in this area. The sentries are equipped with rudimentary magic that can conceal their location from future attacks, however. Before that will work they need to be repaired.")
  89. end
  90. function Option5(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. local conversation = CreateConversation()
  93. AddConversationOption(conversation, "How many sentries are there?", "Option6")
  94. StartConversation(conversation, NPC, Spawn, "We've got supplies cached in the houses south of the ruins. Some of those crates will contain essence injectors. You only need one. Once you have one, head into the ruins. The undead that are destroyed rot into undeath... and that can be reaped. Collect an essence of undeath from one of the fallen undead and use it with the injector to repair one of the sentries. After that collect another essence and repair the next one.")
  95. end
  96. function Option6(NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. local conversation = CreateConversation()
  99. AddConversationOption(conversation, "Yes.", "offer")
  100. StartConversation(conversation, NPC, Spawn, "There are six: two above the road that runs east and west, and four below it. They are all on the outskirts of the ruins. Think you can do it?")
  101. end
  102. function Option8(NPC, Spawn)
  103. if GetQuestStep(Spawn, QUEST2) == 8 then
  104. SetStepComplete(Spawn, QUEST2, 8)
  105. end
  106. FaceTarget(NPC, Spawn)
  107. local conversation = CreateConversation()
  108. AddConversationOption(conversation, "You're welcome.", "Option9")
  109. StartConversation(conversation, NPC, Spawn, "Great work! This is going to save us a lot of scouting time. Thank you, Ighi.")
  110. end
  111. function Option9(NPC, Spawn)
  112. FaceTarget(NPC, Spawn)
  113. local conversation = CreateConversation()
  114. AddConversationOption(conversation, "Strange research?", "Option10")
  115. StartConversation(conversation, NPC, Spawn, "We got another lucky break. Our scouts report that the Bloodskulls we had been following have settled down and are doing some strange research.")
  116. end
  117. function Option10(NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. local conversation = CreateConversation()
  120. AddConversationOption(conversation, "What else do you want me to do?", "Option11")
  121. StartConversation(conversation, NPC, Spawn, "Something having to do with the ghostly treants they've set up camp near. They're orcs so I doubt it's very advanced... still, I would like you to get rid of some of the shamans doing the research. The less the orcs have to work with the better off we are.")
  122. end
  123. function Option11(NPC, Spawn)
  124. FaceTarget(NPC, Spawn)
  125. local conversation = CreateConversation()
  126. AddConversationOption(conversation, "Where is the camp?", "Option12")
  127. StartConversation(conversation, NPC, Spawn, "They have two leaders: Vurog Ma'gar and Jyrok the Stone. Take them out. Then find Arnisu Tobian. He is posing as their prisoner. Get his report on their studies and bring it back to me. This strike will be enough for our needs, but will not force the Bloodskulls into an action we won't be ready to deal with.")
  128. end
  129. function Option12(NPC, Spawn)
  130. FaceTarget(NPC, Spawn)
  131. local conversation = CreateConversation()
  132. AddConversationOption(conversation, "All right, I'll go do it.", "offer2")
  133. StartConversation(conversation, NPC, Spawn, "From the southern most branch of the river it is south. There will be a small path leading into the mountainous area. That path will lead to their camp. It is on the southern edge of the Commonlands, east of the entrance to Bloodskull Valley.")
  134. end
  135. function Option13(NPC, Spawn)
  136. FaceTarget(NPC, Spawn)
  137. local conversation = CreateConversation()
  138. AddConversationOption(conversation, "What does the report tell you?", "Option14")
  139. StartConversation(conversation, NPC, Spawn, "Great! Finally things are coming under control. You've done a lot for us, "..GetName(Spawn)..", thank you.")
  140. end
  141. function Option14(NPC, Spawn)
  142. FaceTarget(NPC, Spawn)
  143. local conversation = CreateConversation()
  144. AddConversationOption(conversation, "What does that mean?", "Option15")
  145. StartConversation(conversation, NPC, Spawn, "Hmm... orcs raising the dead. Perhaps this is the missing bit of information that connects the Bloodskulls to the Shin'Ree.")
  146. end
  147. function Option15(NPC, Spawn)
  148. FaceTarget(NPC, Spawn)
  149. local conversation = CreateConversation()
  150. AddConversationOption(conversation, "Ok.", "offer3")
  151. StartConversation(conversation, NPC, Spawn, "At this point you're better off not knowing. If you are needed you will be called upon. For now, I would return to Feralis if I were you. I'm sure he'll want to thank you personally.")
  152. end
  153. function offer(NPC, Spawn)
  154. FaceTarget(NPC, Spawn)
  155. OfferQuest(NPC, Spawn, QUEST2)
  156. end
  157. function offer2(NPC, Spawn)
  158. FaceTarget(NPC, Spawn)
  159. OfferQuest(NPC, Spawn, QUEST3)
  160. end
  161. function offer3(NPC, Spawn)
  162. FaceTarget(NPC, Spawn)
  163. OfferQuest(NPC, Spawn, QUEST4)
  164. end
  165. function QUEST2_PROGRESS(NPC, Spawn)
  166. FaceTarget(NPC, Spawn)
  167. local conversation = CreateConversation()
  168. AddConversationOption(conversation, "Not yet.")
  169. StartConversation(conversation, NPC, Spawn, "Are the sentries repaired?")
  170. end
  171. function QUEST2_FINISH(NPC, Spawn)
  172. FaceTarget(NPC, Spawn)
  173. local conversation = CreateConversation()
  174. AddConversationOption(conversation, "Yes, they are all working and hidden.", "Option8")
  175. StartConversation(conversation, NPC, Spawn, "Are the sentries repaired?")
  176. end
  177. function QUEST3_PROGRESS(NPC, Spawn)
  178. FaceTarget(NPC, Spawn)
  179. local conversation = CreateConversation()
  180. AddConversationOption(conversation, "Not yet.")
  181. StartConversation(conversation, NPC, Spawn, "Have you done it all?")
  182. end
  183. function QUEST3_FINISH(NPC, Spawn)
  184. if GetQuestStep(Spawn, QUEST3) == 5 then
  185. SetStepComplete(Spawn, QUEST3, 5)
  186. end
  187. FaceTarget(NPC, Spawn)
  188. local conversation = CreateConversation()
  189. AddConversationOption(conversation, "I have. Here is Arnisu's report.", "Option13")
  190. StartConversation(conversation, NPC, Spawn, "Have you done it all?")
  191. end
  192. function respawn(NPC)
  193. spawn(NPC)
  194. end