DavynThornbranch.lua 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/DavynThornbranch.lua
  3. Script Purpose : Davyn Thornbranch
  4. Script Author : Scatman
  5. Script Date : 2009.09.15
  6. Script Notes : Updated by Jabantiz (4/21/2017)
  7. --]]
  8. local WOOD_ELF_QUEST_1 = 213 -- Offering Help
  9. local WOOD_ELF_QUEST_2 = 214 -- Tribute Leaves
  10. local WOOD_ELF_QUEST_3 = 215 -- A Task for Davyn
  11. local WOOD_ELF_QUEST_4 = 216 -- Tribute Flowers
  12. local WOOD_ELF_QUEST_5 = 217 -- A Tribute for Ulinir
  13. function spawn(NPC)
  14. ProvidesQuest(NPC, WOOD_ELF_QUEST_3)
  15. ProvidesQuest(NPC, WOOD_ELF_QUEST_5)
  16. end
  17. function hailed(NPC, Spawn)
  18. FaceTarget(NPC, Spawn)
  19. conversation = CreateConversation()
  20. if HasCompletedQuest(Spawn, WOOD_ELF_QUEST_1) then
  21. if HasCompletedQuest(Spawn, WOOD_ELF_QUEST_2) then
  22. if HasCompletedQuest(Spawn, WOOD_ELF_QUEST_3) then
  23. if HasCompletedQuest(Spawn, WOOD_ELF_QUEST_4) then
  24. if HasCompletedQuest(Spawn, WOOD_ELF_QUEST_5) then
  25. DeliveredTributeYet(NPC, Spawn, conversation)
  26. elseif HasQuest(Spawn, WOOD_ELF_QUEST_5) then
  27. DeliveredTributeYet(NPC, Spawn, conversation)
  28. else
  29. MeantTributeMine(NPC, Spawn)
  30. end
  31. elseif HasQuest(Spawn, WOOD_ELF_QUEST_4) then
  32. if GetQuestStep(Spawn, WOOD_ELF_QUEST_4) == 3 then
  33. HowGoesWorkOnTribute(NPC, Spawn, conversation)
  34. else
  35. Say(NPC, "Now that you've helped me you should go speak with Aelis again.", Spawn)
  36. end
  37. else
  38. Say(NPC, "Now that you've helped me you should go speak with Aelis again.", Spawn)
  39. end
  40. elseif HasQuest(Spawn, WOOD_ELF_QUEST_3) then
  41. if GetQuestStep(Spawn, WOOD_ELF_QUEST_3) == 6 then
  42. Say(NPC, "Now that you've helped me you should go speak with Aelis again.", Spawn)
  43. else
  44. FoundWolfYet(NPC, Spawn, conversation)
  45. end
  46. else
  47. IsMyTributeComplete(NPC, Spawn, conversation)
  48. end
  49. elseif HasQuest(Spawn, WOOD_ELF_QUEST_2) then
  50. if GetQuestStep(Spawn, WOOD_ELF_QUEST_2) == 1 or GetQuestStep(Spawn, WOOD_ELF_QUEST_2) == 2 then
  51. Say(NPC, "I hope you and Aelis are getting along well.", Spawn)
  52. elseif GetQuestStep(Spawn, WOOD_ELF_QUEST_2) == 3 then
  53. IsMyTributeComplete(NPC, Spawn, conversation)
  54. end
  55. else
  56. Say(NPC, "I hope you and Aelis are getting along well.", Spawn)
  57. end
  58. elseif HasQuest(Spawn, WOOD_ELF_QUEST_1) then
  59. if GetQuestStep(Spawn, WOOD_ELF_QUEST_1) == 1 then
  60. GoodDayToYou(NPC, Spawn, conversation)
  61. elseif GetQuestStep(Spawn, WOOD_ELF_QUEST_1) == 2 then
  62. Say(NPC, "I hope you and Aelis are getting along well.", Spawn)
  63. end
  64. else
  65. Say(NPC, "Sorry, I'm kind of busy right now.", Spawn)
  66. end
  67. end
  68. --------------------------------------------------------------------------------------------------------------------------------
  69. -- QUEST 1
  70. --------------------------------------------------------------------------------------------------------------------------------
  71. function GoodDayToYou(NPC, Spawn, conversation)
  72. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch001.mp3", "", "", 3860010631, 4122099989, Spawn)
  73. AddConversationOption(conversation, "How are you doing today?", "FineAndYou")
  74. AddConversationOption(conversation, "And to you. Good-bye for now.")
  75. StartConversation(conversation, NPC, Spawn, "Good day to you.")
  76. end
  77. function FineAndYou(NPC, Spawn)
  78. FaceTarget(NPC, Spawn)
  79. conversation = CreateConversation()
  80. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch002.mp3", "", "", 316906143, 655236793, Spawn)
  81. AddConversationOption(conversation, "I feel wonderful.", "dlg_3_2")
  82. AddConversationOption(conversation, "I am well.", "dlg_3_2")
  83. AddConversationOption(conversation, "I am not so well.", "dlg_5_2")
  84. AddConversationOption(conversation, "I feel terrible.", "dlg_5_2")
  85. StartConversation(conversation, NPC, Spawn, "I am fine, and you?")
  86. end
  87. function dlg_3_2(NPC, Spawn)
  88. FaceTarget(NPC, Spawn)
  89. conversation = CreateConversation()
  90. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch003.mp3", "", "", 2401906927, 1079328143, Spawn)
  91. AddConversationOption(conversation, "Nothing too troubling, I hope.", "dlg_6_4")
  92. AddConversationOption(conversation, "I will be going then.")
  93. StartConversation(conversation, NPC, Spawn, "That is good to hear. I apologize for being terse, but I am in the middle of some thoughts.")
  94. end
  95. function dlg_5_2(NPC, Spawn)
  96. FaceTarget(NPC, Spawn)
  97. conversation = CreateConversation()
  98. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch004.mp3", "", "", 2608502735, 3672722454, Spawn)
  99. AddConversationOption(conversation, "Nothing too troubling, I hope.", "dlg_6_4")
  100. AddConversationOption(conversation, "I will be going then.")
  101. StartConversation(conversation, NPC, Spawn, "That is unfortunate, though without the dark there would be no light. I apologize for being terse, but I am in the middle of some thoughts.")
  102. end
  103. function dlg_6_3(NPC, Spawn)
  104. FaceTarget(NPC, Spawn)
  105. conversation = CreateConversation()
  106. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch005.mp3", "", "", 4284267619, 900168490, Spawn)
  107. AddConversationOption(conversation, "Is there anything I can do to help?", "dlg_6_4")
  108. StartConversation(conversation, NPC, Spawn, "Not troubling, no. But important, and thus hard not to worry about.")
  109. end
  110. function dlg_6_4(NPC, Spawn)
  111. FaceTarget(NPC, Spawn)
  112. conversation = CreateConversation()
  113. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch008.mp3", "", "", 1201358473, 1534683104, Spawn)
  114. AddConversationOption(conversation, "What must I do?", "dlg_6_5")
  115. StartConversation(conversation, NPC, Spawn, "I am working on a Feir'Dal tribute for my old friend Ulinir. He was a very dear friend; a tribute is the least I could do. Sadly I am unable to focus properly and have been unable to make any progress at all. I suppose it speaks of some inner turmoil on my part, but I hate to keep Ulinir waiting. If you could help me create his tribute I would be very grateful.")
  116. end
  117. function dlg_6_5(NPC, Spawn)
  118. SetStepComplete(Spawn, WOOD_ELF_QUEST_1, 1)
  119. FaceTarget(NPC, Spawn)
  120. conversation = CreateConversation()
  121. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch009.mp3", "", "", 2426834769, 2651026217, Spawn)
  122. AddConversationOption(conversation, "I'll go speak with her.")
  123. StartConversation(conversation, NPC, Spawn, "I appreciate this more than you know. Go speak with Aelis. She should be on or near the docks. Tell her that you would like to help me create my tribute; she will know what to do.")
  124. end
  125. -------------------------------------------------------------------------------------------------------------------------------------------------------
  126. -- QUEST 2
  127. -------------------------------------------------------------------------------------------------------------------------------------------------------
  128. function IsMyTributeComplete(NPC, Spawn, conversation)
  129. AddConversationOption(conversation, "Aelis said I needed to do a task for you as part of the tribute creation.", "dlg_12_1")
  130. AddConversationOption(conversation, "No, not yet.")
  131. StartConversation(conversation, NPC, Spawn, "Is my tribute complete?")
  132. end
  133. function dlg_12_1(NPC, Spawn)
  134. if HasQuest(Spawn, WOOD_ELF_QUEST_2) then
  135. SetStepComplete(Spawn, WOOD_ELF_QUEST_2, 3)
  136. end
  137. FaceTarget(NPC, Spawn)
  138. conversation = CreateConversation()
  139. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch011.mp3", "", "", 20096395, 3481349416, Spawn)
  140. AddConversationOption(conversation, "She said it could be any task, large or small.", "IHaveOneThing")
  141. StartConversation(conversation, NPC, Spawn, "Hmm, that's a little humorous, considering the tribute is already a favor you're doing for me. What kind of task did you need to do for me?")
  142. end
  143. -------------------------------------------------------------------------------------------------------------------------------------------------------
  144. -- QUEST 3
  145. -------------------------------------------------------------------------------------------------------------------------------------------------------
  146. function IHaveOneThing(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. conversation = CreateConversation()
  149. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch012.mp3", "", "", 678144380, 633781914, Spawn)
  150. AddConversationOption(conversation, "Sure.", "CitizenReportedWolf")
  151. AddConversationOption(conversation, "No, I'll hold off for now.")
  152. StartConversation(conversation, NPC, Spawn, "I do have one thing you could do to satisfy Aelis' requirements, though it might be a little dangerous. Do you want to try?")
  153. end
  154. function CitizenReportedWolf(NPC, Spawn)
  155. FaceTarget(NPC, Spawn)
  156. conversation = CreateConversation()
  157. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch013.mp3", "", "", 539477564, 2851114968, Spawn)
  158. AddConversationOption(conversation, "I will speak with him immediately.", "OfferQuest3")
  159. AddConversationOption(conversation, "Perhaps another time.")
  160. StartConversation(conversation, NPC, Spawn, "A citizen reported seeing a wolf last night. Normally that isn't anything to worry about, but the behavior of this wolf was described as very, very aggressive. I am afraid Willow Wood may have a rabid wolf among its citizens. The initial report came from a man named Taval Zane. He is staying at the inn just just south of here. I suggest you start with him.")
  161. end
  162. function OfferQuest3(NPC, Spawn)
  163. FaceTarget(NPC, Spawn)
  164. OfferQuest(NPC, Spawn, WOOD_ELF_QUEST_3)
  165. end
  166. function FoundWolfYet(NPC, Spawn, conversation)
  167. if GetQuestStep(Spawn, WOOD_ELF_QUEST_3) == 5 then
  168. AddConversationOption(conversation, "Yes, the wolf is dead.", "dlg_21_1")
  169. end
  170. AddConversationOption(conversation, "No, not yet.")
  171. StartConversation(conversation, NPC, Spawn, "Have you found the wolf yet?")
  172. end
  173. function dlg_21_1(NPC, Spawn)
  174. SetStepComplete(Spawn, WOOD_ELF_QUEST_3, 5)
  175. FaceTarget(NPC, Spawn)
  176. conversation = CreateConversation()
  177. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch015.mp3", "", "", 1785285003, 1047753849, Spawn)
  178. AddConversationOption(conversation, "I am glad to have helped.", "dlg_21_2")
  179. StartConversation(conversation, NPC, Spawn, "I am sorry to have given you such a grim task. You have helped the village greatly, though.")
  180. end
  181. function dlg_21_2(NPC, Spawn)
  182. FaceTarget(NPC, Spawn)
  183. conversation = CreateConversation()
  184. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch016.mp3", "", "", 2783457255, 1132022982, Spawn)
  185. AddConversationOption(conversation, "I shall.")
  186. StartConversation(conversation, NPC, Spawn, "I am glad you did help... Well, I guess you should be getting back to Aelis now.")
  187. end
  188. -----------------------------------------------------------------------------------------------------------------------
  189. -- QUEST 4
  190. -----------------------------------------------------------------------------------------------------------------------
  191. function HowGoesWorkOnTribute(NPC, Spawn, conversation)
  192. AddConversationOption(conversation, "You mean your tribute?", "MeantTributeMine")
  193. AddConversationOption(conversation, "I am not quite done.")
  194. StartConversation(conversation, NPC, Spawn, "How goes work on your tribute?")
  195. end
  196. function MeantTributeMine(NPC, Spawn)
  197. if HasQuest(Spawn, WOOD_ELF_QUEST_4) then
  198. SetStepComplete(Spawn, WOOD_ELF_QUEST_4, 3)
  199. end
  200. FaceTarget(NPC, Spawn)
  201. conversation = CreateConversation()
  202. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch018.mp3", "", "", 3806105401, 4200917967, Spawn)
  203. AddConversationOption(conversation, "Yes, I think I can do that.", "dlg_25_2")
  204. AddConversationOption(conversation, "No, thank you.")
  205. StartConversation(conversation, NPC, Spawn, "I meant the tribute to be mine alone at first, but you and Aelis are the ones who made this tribute. It would be disrespectful for me to present it to Ulinir. I think you should use the tribute as your own and place it on Ulinir's grave. I know you didn't know him, but he was most certainly worthy. What do you say?")
  206. end
  207. ---------------------------------------------------------------------------------------------------------------------------
  208. -- QUEST 5
  209. ---------------------------------------------------------------------------------------------------------------------------
  210. function dlg_25_2(NPC, Spawn)
  211. FaceTarget(NPC, Spawn)
  212. conversation = CreateConversation()
  213. PlayFlavor(NPC, "voiceover/english/tutorial_revamp/davyn_thornbranch/qey_village05/quests/davyn_thornbranch/davyn_thornbranch019.mp3", "", "", 795265842, 2129977796, Spawn)
  214. AddConversationOption(conversation, "Very well; I shall do that now.", "OfferQuest5")
  215. AddConversationOption(conversation, "I have no time to do this now.")
  216. StartConversation(conversation, NPC, Spawn, "I was hoping you would say that. You can find Ulinir's grave in the Forest Ruins. His grave is outside of the ruins themselves, to the northeast of them. There is a river that runs under the actual ruins. Ulinir's grave is at the end of that river.")
  217. end
  218. function OfferQuest5(NPC, Spawn)
  219. FaceTarget(NPC, Spawn)
  220. OfferQuest(NPC, Spawn, WOOD_ELF_QUEST_5)
  221. end
  222. function DeliveredTributeYet(NPC, Spawn, conversation)
  223. FaceTarget(NPC, Spawn)
  224. conversation = CreateConversation()
  225. if HasCompletedQuest(Spawn, WOOD_ELF_QUEST_5) then
  226. AddConversationOption(conversation, "Yes. Yes, I have.", "DeliveredTribute")
  227. end
  228. AddConversationOption(conversation, "No, I have not yet.")
  229. StartConversation(conversation, NPC, Spawn, "Have you delivered the tribute yet?")
  230. end
  231. function DeliveredTribute(NPC, Spawn)
  232. FaceTarget(NPC, Spawn)
  233. conversation = CreateConversation()
  234. AddConversationOption(conversation, "You are welcome.")
  235. StartConversation(conversation, NPC, Spawn, "Good. Ulinir will know a small part of it is from me as such, he will accept you as a friend. Thank you again, friend.")
  236. end