HartokWoolyman.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. --[[
  2. Script Name : SpawnScripts/Antonica/HartokWoolyman.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.08.22 07:08:44
  5. Script Purpose :
  6. :
  7. --]]
  8. local PatchworkRugs = 5344 -- Patchwork Rugs quest
  9. local DoorToDoorDelivery = 5346 -- Door to Door Delivery quest
  10. local AttackOfTheKillerBear = 5347 -- Attack of the Killer Bear quest
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 15, "InRange")
  13. end
  14. function InRange(NPC, Spawn)
  15. if not HasQuest(Spawn, PatchworkRugs) and not HasCompletedQuest(Spawn, PatchworkRugs) then
  16. ProvidesQuest(NPC, PatchworkRugs)
  17. SetInfoFlag(NPC)
  18. SetVisualFlag(NPC)
  19. elseif HasCompletedQuest(Spawn, PatchworkRugs) then
  20. ProvidesQuest(NPC, DoorToDoorDelivery)
  21. SetInfoFlag(NPC)
  22. SetVisualFlag(NPC)
  23. elseif HasCompletedQuest(Spawn, DoorToDoorDelivery) then
  24. ProvidesQuest(NPC, AttackOfTheKillerBear)
  25. SetInfoFlag(NPC)
  26. SetVisualFlag(NPC)
  27. end
  28. end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. local choice = MakeRandomInt(1, 3)
  32. if choice == 1 then
  33. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_2_1010.mp3", "", "", 0, 0, Spawn)
  34. elseif choice == 2 then
  35. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1010.mp3", "", "", 0, 0, Spawn)
  36. elseif choice == 3 then
  37. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_3_1010.mp3", "", "", 0, 0, Spawn)
  38. end
  39. if not HasQuest(Spawn, PatchworkRugs) and not HasCompletedQuest(Spawn, PatchworkRugs) then
  40. Option1(NPC, Spawn)
  41. elseif HasCompletedQuest(Spawn, PatchworkRugs) and not HasQuest(Spawn, DoorToDoorDelivery) and not HasCompletedQuest(Spawn, DoorToDoorDelivery) then
  42. Option7(NPC, Spawn)
  43. elseif HasCompletedQuest(Spawn, PatchworkRugs) and HasCompletedQuest(Spawn, DoorToDoorDelivery) and not HasQuest(Spawn, AttackOfTheKillerBear) and not HasCompletedQuest(Spawn, AttackOfTheKillerBear) then
  44. Option11(NPC, Spawn)
  45. elseif GetQuestStep(Spawn, PatchworkRugs) == 1 or GetQuestStep(Spawn, DoorToDoorDelivery) == 1 or GetQuestStep(Spawn, AttackOfTheKillerBear)==1 then
  46. Quest_Progress(NPC, Spawn)
  47. elseif GetQuestStep(Spawn, PatchworkRugs) == 2 then
  48. Option6(NPC, Spawn)
  49. elseif GetQuestStep(Spawn, DoorToDoorDelivery) == 2 then
  50. Option10(NPC, Spawn)
  51. elseif GetQuestStep(Spawn, AttackOfTheKillerBear) == 2 then
  52. Option16(NPC, Spawn)
  53. elseif HasCompletedQuest(Spawn, PatchworkRugs) and HasCompletedQuest(Spawn, DoorToDoorDelivery) and HasCompletedQuest(Spawn, AttackOfTheKillerBear) then
  54. PlayFlavor(NPC, "", "Thanks again! I think I'll be safe for the time being.", "", 1689589577, 4560189, Spawn)
  55. end
  56. end
  57. function Option1(NPC, Spawn)
  58. local conversation = CreateConversation()
  59. AddConversationOption(conversation, "Actually, I am looking for work.", "Option2")
  60. AddConversationOption(conversation, "Well, if you're going to be like that....")
  61. StartConversation(conversation, NPC, Spawn, "Hello, adventurer! Would you care for a nice bearskin rug for your abode? I made them myself. If you don't want one, get lost! I have things to do.")
  62. end
  63. function Option2(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. local conversation = CreateConversation()
  66. AddConversationOption(conversation, "Maybe, if the price is right.", "Option3")
  67. AddConversationOption(conversation, "I don't feel like it.")
  68. StartConversation(conversation, NPC, Spawn, "Looking for work, huh? I think I can find something for you to do. You see, I make these here bearskin rugs, and I am finding less and less time to gather the pelts myself. Perhaps you can help.")
  69. end
  70. function Option3(NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. local conversation = CreateConversation()
  73. AddConversationOption(conversation, "Okay, so what do you need?", "Option4")
  74. AddConversationOption(conversation, "Bye.")
  75. StartConversation(conversation, NPC, Spawn, "Look, don't get ahead of yourself. It's not like Holly Windstalker is going to be chasing you down for killing her precious bears! Ha! As a matter of fact, I have been killing every bear I have seen for years, and nothing has stopped me yet!")
  76. end
  77. function Option4(NPC, Spawn)
  78. FaceTarget(NPC, Spawn)
  79. local conversation = CreateConversation()
  80. AddConversationOption(conversation, "Sure, that doesn't sound so bad.", "Option5")
  81. AddConversationOption(conversation, "Bye.")
  82. StartConversation(conversation, NPC, Spawn, "I need you to kill some bears for me, of course. You see, I have so many orders to fill, I can't even think of going out and getting them myself. So, from time to time, I look to adventurers such as yourself to help me out a little bit.")
  83. end
  84. function Option5(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. local conversation = CreateConversation()
  87. AddConversationOption(conversation, "Okay, kill bears. Got it.", "offer")
  88. AddConversationOption(conversation, "Bye.")
  89. StartConversation(conversation, NPC, Spawn, "There are plenty of bears out around these parts. These parts were protected for so long, it seems like it's instinct for them to come here and gather. Business is booming and there is no end of supply in sight!")
  90. end
  91. function Option6(NPC, Spawn)
  92. SetStepComplete(Spawn, PatchworkRugs, 2)
  93. FaceTarget(NPC, Spawn)
  94. local conversation = CreateConversation()
  95. AddConversationOption(conversation, "I just might have the time, thank you.")
  96. StartConversation(conversation, NPC, Spawn, "Great! These pelts are beautiful. Good job. You know, you do pretty good work for a whelp. I think I could use some more help if you have the time.")
  97. end
  98. function Option7(NPC, Spawn)
  99. FaceTarget(NPC, Spawn)
  100. local conversation = CreateConversation()
  101. AddConversationOption(conversation, "Sure, what do you have for me?", "Option8")
  102. AddConversationOption(conversation, "Bye, then.")
  103. StartConversation(conversation, NPC, Spawn, "Okay, look. I have work to do. If you want a task, just ask. Otherwise, please be on your way.")
  104. end
  105. function Option8(NPC, Spawn)
  106. FaceTarget(NPC, Spawn)
  107. local conversation = CreateConversation()
  108. AddConversationOption(conversation, "Sure. Anything else?", "Option9")
  109. AddConversationOption(conversation, "Bye.")
  110. StartConversation(conversation, NPC, Spawn, "So, I just got an order for another 10 rugs. I don't have the time to run all over the place delivering these things to everybody. I need you to run over to The Keep of the Gnollslayers and deliver these rugs to Lord Bennet. Give him this note and make sure you collect payment.")
  111. end
  112. function Option9(NPC, Spawn)
  113. FaceTarget(NPC, Spawn)
  114. local conversation = CreateConversation()
  115. AddConversationOption(conversation, "Things to take care of?", "offer2")
  116. StartConversation(conversation, NPC, Spawn, "Yeah, he may ask where I have been lately. Just tell him I have been... uhhh... Tell him I have been busy. Oh, and also tell him that I won't be by this week. I have things to take care of.")
  117. end
  118. function Option10(NPC, Spawn)
  119. SetStepComplete(Spawn, DoorToDoorDelivery, 2)
  120. FaceTarget(NPC, Spawn)
  121. local conversation = CreateConversation()
  122. AddConversationOption(conversation, "No problem, I guess.")
  123. StartConversation(conversation, NPC, Spawn, "Ahh, good work! I was afraid you wouldn't return! I mean... that you might... umm... never mind. Thanks for the favor!")
  124. end
  125. function Option11(NPC, Spawn)
  126. FaceTarget(NPC, Spawn)
  127. local conversation = CreateConversation()
  128. AddConversationOption(conversation, "Sure, what is it?", "Option12")
  129. AddConversationOption(conversation, "I don't feel like it.")
  130. StartConversation(conversation, NPC, Spawn, "Hey there. Umm...let me be straight with you. You seem to be able to handle yourself quite well. I umm... I need a favor. ")
  131. end
  132. function Option12(NPC, Spawn)
  133. FaceTarget(NPC, Spawn)
  134. local conversation = CreateConversation()
  135. AddConversationOption(conversation, "I don't understand.", "Option13")
  136. AddConversationOption(conversation, "Bye.")
  137. StartConversation(conversation, NPC, Spawn, "You see, business is doing rather well, but that's not why I can't leave this place. See, business is doing so well, that uhh... I think something is after me.")
  138. end
  139. function Option13(NPC, Spawn)
  140. FaceTarget(NPC, Spawn)
  141. local conversation = CreateConversation()
  142. AddConversationOption(conversation, "Okay, so it hated you. What's the point?", "Option14")
  143. AddConversationOption(conversation, "Bye.")
  144. StartConversation(conversation, NPC, Spawn, "I have only seen it once. On my last trip out to get some more pelts, she came running out of some trees. I have never seen actual hate in the eyes of any of the game I have hunted, but this creature... This creature hated me.")
  145. end
  146. function Option14(NPC, Spawn)
  147. FaceTarget(NPC, Spawn)
  148. local conversation = CreateConversation()
  149. AddConversationOption(conversation, "Okay, but it's going to cost you.", "Option15")
  150. AddConversationOption(conversation, "Not this time.")
  151. StartConversation(conversation, NPC, Spawn, "I believe that this bear has grown to recognize me, and wants nothing more than to see me dead. I have seen it in her eyes. When I saw those eyes, I felt as though Holly Windstalker herself was looking at me through that beast's eyes. Please, just rid this world of that beast, so I can get back to my business in peace. ")
  152. end
  153. function Option15(NPC, Spawn)
  154. FaceTarget(NPC, Spawn)
  155. local conversation = CreateConversation()
  156. AddConversationOption(conversation, "I will seek this beast out.", "offer3")
  157. StartConversation(conversation, NPC, Spawn, "If you make it past that beast alive I will be happy to reward you. Just please, get rid of that thing! I last saw her in the Shattered Vale located within the mountain range to the southeast. If you find a Giantslayer messenger on the way, you may find a way to \"ask\" them how to get inside the vale.")
  158. end
  159. function Option16(NPC, Spawn)
  160. SetStepComplete(Spawn, AttackOfTheKillerBear, 2)
  161. FaceTarget(NPC, Spawn)
  162. local conversation = CreateConversation()
  163. AddConversationOption(conversation, "Good luck with that.")
  164. StartConversation(conversation, NPC, Spawn, "You did it! Thank you so much, friend. I must have just been imagining things. To think, I actually thought that somehow old Holly Windstalker sent that creature after me. Can you believe it? I guess sometimes those old myths can get to even the best of us. Now, I can get back to business. I have lots of orders to fill! Haha! ")
  165. end
  166. function offer(NPC, Spawn)
  167. OfferQuest(NPC, Spawn, PatchworkRugs)
  168. end
  169. function offer2(NPC, Spawn)
  170. OfferQuest(NPC, Spawn, DoorToDoorDelivery)
  171. end
  172. function offer3(NPC, Spawn)
  173. OfferQuest(NPC, Spawn, AttackOfTheKillerBear)
  174. end
  175. function Quest_Progress(NPC, Spawn)
  176. PlayFlavor(NPC, "", "Hey! What are you doing back here so soon? I don't want to hear any excuses. Come back when you finish the task I have given you, or don't return at all!", "", 1689589577, 4560189, Spawn)
  177. end
  178. function respawn(NPC)
  179. spawn(NPC)
  180. end