9
3

InnkeeperValean.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. --[[
  2. Script Name : SpawnScripts/Castleview/InnkeeperValean.lua
  3. Script Purpose : Innkeeper Valean <Housing>
  4. Script Author : Dorbin
  5. Script Date : 2022.01.15
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Books = 5453
  10. local Delivery = 5443
  11. local Dinner = 238
  12. local Reservation = 5452
  13. local LostBook = 5468
  14. function spawn(NPC)
  15. ProvidesQuest(NPC,Books)
  16. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function InRange (NPC,Spawn)
  22. if not HasQuest(Spawn, LostBook) and not HasCompletedQuest(Spawn, LostBooks) then
  23. if math.random(1, 100) <= 70 then
  24. PlayFlavor(NPC, "voiceover/english/innkeeper_valean/qey_village04/100_innkeeper_valean_callout_9071232c.mp3", "Welcome to the Bed and Book Inn. A fine establishment for recuperating a body and expanding a mind.", "hello", 1080804291, 518202081, Spawn)
  25. end
  26. else
  27. if math.random(1, 100) <= 60 then
  28. local choice = MakeRandomInt(1,5)
  29. if choice == 1 then
  30. PlayFlavor(NPC, "voiceover/english/optional2/highelf_eco_good_1/ft/service/innkeeper/highelf_innkeeper_service_good_1_hail_gm_ff8f2e0b.mp3", "Is there something I can get for you. Do you need extra towels or a new set of sheets?", "shrug", 3357488044, 3163163637, Spawn, 0)
  31. elseif choice == 2 then
  32. PlayFlavor(NPC, "voiceover/english/innkeeper_valean/qey_village04/100_innkeeper_valean_callout_9071232c.mp3", "Welcome to the Bed and Book Inn, a fine establishment for recuperating the body and expanding the mind. ", "bow", 1080804291, 518202081, Spawn, 0)
  33. elseif choice == 3 then
  34. PlayFlavor(NPC, "voiceover/english/optional2/highelf_eco_good_1/ft/service/innkeeper/highelf_innkeeper_service_good_1_hail_gm_df81b278.mp3", "Will you be needing a room for the evening?", "hello", 3897504580, 3514026923, Spawn, 0)
  35. elseif choice == 4 then
  36. PlayFlavor(NPC, "voiceover/english/optional2/highelf_eco_good_1/ft/service/innkeeper/highelf_innkeeper_service_good_1_hail_gm_f9f93f86.mp3", "Many adventurers fresh from the road, head straight in to have a hot bath. Shall I prepare one for you?", "wink", 2107402357, 2798748961, Spawn, 0) end
  37. end
  38. end
  39. end
  40. --
  41. function hailed(NPC, Spawn)
  42. FaceTarget(NPC, Spawn)
  43. Dialog.New(NPC, Spawn)
  44. Dialog.AddDialog("Welcome to the Bed and Book Inn. A fine establishment for recuperating a body and expanding a mind. We have many fine rooms available. Interested, traveler?")
  45. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean.mp3", 3631971111,2641145010)
  46. PlayFlavor(NPC, "", "", "bow",0,0, Spawn)
  47. if GetQuestStep (Spawn, Delivery) == 1 then
  48. Dialog.AddOption("Ganla Dindlenod wants you to take a look at this book.", "BookDelivery")
  49. end
  50. if GetQuestStep (Spawn, Dinner) == 1 then
  51. Dialog.AddOption("Actually, I am here to deliver a message to you from Faeadaen. She has to work late and won't be able to dine with you tonight.", "NoDinner")
  52. end
  53. if GetQuestStep (Spawn, Reservation) == 1 then
  54. Dialog.AddOption("I need to make a room reservation for Taneran.", "KnowTaneran")
  55. end
  56. if not HasQuest(Spawn,Books) and not HasCompletedQuest(Spawn,Books) then
  57. Dialog.AddOption("You have a great number of books in your collection.", "BookCollection")
  58. end
  59. if GetQuestStep (Spawn, Books) == 2 then
  60. Dialog.AddOption("I found your books being sold in the catacombs.", "FoundBooks")
  61. end
  62. if GetQuestStep (Spawn, LostBook) == 2 then
  63. Dialog.AddOption("Faeadaen mentioned she left a book of Arbos here. Have you seen it?", "Arbos")
  64. end
  65. Dialog.AddOption("Yes.", "dlg_2_1")
  66. Dialog.AddOption("I am not interested in a room at this time.")
  67. Dialog.Start()
  68. end
  69. function Arbos(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. conversation = CreateConversation()
  72. AddConversationOption(conversation, "Alright. I'll check the shelves for the book.")
  73. StartConversation(conversation, NPC, Spawn, "Yes! I've just recently shelved the book on the Great Tree. Unfortunately, I don't recall where it is amongst my other books. You're welcome to look at my collections upstairs for it.")
  74. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  75. end
  76. function BookDelivery(NPC, Spawn)
  77. SetStepComplete(Spawn, Delivery, 1)
  78. FaceTarget(NPC, Spawn)
  79. Dialog.New(NPC, Spawn)
  80. Dialog.AddDialog("Ah, Yes! Ganla's treasure! I was expecting this. I shall decipher it, but it will take some time. Please inform Ganla I will return the journal as soon as possible.")
  81. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean005.mp3", 3924782316,102930417)
  82. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  83. Dialog.AddOption( "I'll let Ganla know. I hope it contains something good!")
  84. Dialog.Start()
  85. end
  86. function NoDinner(NPC, Spawn)
  87. SetStepComplete(Spawn, Dinner, 1)
  88. FaceTarget(NPC, Spawn)
  89. Dialog.New(NPC, Spawn)
  90. Dialog.AddDialog("Again?! That froglok should hire more people so Faeadaen isn't worked to the bone. Thanks for letting me know. I guess I'll dine alone tonight.")
  91. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean000.mp3", 4169629165,2563079815)
  92. PlayFlavor(NPC, "", "", "sigh", 0,0 , Spawn)
  93. Dialog.AddOption( "There is always tomorrow.")
  94. Dialog.Start()
  95. end
  96. function KnowTaneran(NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. Dialog.New(NPC, Spawn)
  99. Dialog.AddDialog("Ah! Taneran! I know him well! It seems he's in town quite often visiting Listalania. They're quite a pair, arn't they? I suppose when they wed I'll lose his loyal patronage at my inn.")
  100. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean001.mp3", 3017286284,4228062292)
  101. PlayFlavor(NPC, "", "", "nod", 0,0 , Spawn)
  102. Dialog.AddOption("That seems like their business, not mine.", "UpdateReservation")
  103. Dialog.AddOption("I don't really know them well.", "UpdateReservation")
  104. Dialog.Start()
  105. end
  106. function UpdateReservation(NPC, Spawn)
  107. FaceTarget(NPC, Spawn)
  108. Dialog.New(NPC, Spawn)
  109. Dialog.AddDialog("Pardon my indiscretion, friend. I assumed... because you're making his reservation that... you were a close friend of Taneran's. He and I speak sometimes when he retires for the night. Please don't mention this to the Lady. I will see that his room is ready.")
  110. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean002.mp3", 1569016427,2379789272)
  111. PlayFlavor(NPC, "", "", "boggle", 0,0 , Spawn)
  112. Dialog.AddOption( "I will let her know.", "ReservationMade")
  113. Dialog.AddOption( "I must congratulation them!", "ReservationMade")
  114. Dialog.AddOption( "Perhaps don't assume next time. Thank you.", "ReservationMade")
  115. Dialog.Start()
  116. end
  117. function BookCollection(NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. Dialog.New(NPC, Spawn)
  120. Dialog.AddDialog("I do have many, but I use to have more before hoodlums pilfered my shelves. I heard tales of a merchant in the Down Below selling books... MY BOOKS! I must confirm this before I approach the Qeynos guard.")
  121. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean003.mp3", 1990579767,1971786194)
  122. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  123. Dialog.AddOption( "If I see them down there, I'll let you know.", "BookLook")
  124. Dialog.AddOption( "The catacombs? Ew. No.")
  125. Dialog.Start()
  126. end
  127. function BookLook (NPC, Spawn)
  128. FaceTarget(NPC, Spawn)
  129. OfferQuest(NPC, Spawn, Books)
  130. end
  131. function FoundBooks(NPC, Spawn)
  132. SetStepComplete(Spawn, Books, 2)
  133. FaceTarget(NPC, Spawn)
  134. Dialog.New(NPC, Spawn)
  135. Dialog.AddDialog("I'll report this to the Qeynos guard! Hopefully they'll lock these criminals up and throw away the key. Thank you for relaying this information. Please, take this small token of my appreciation.")
  136. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean004.mp3", 4073559800,1910490855)
  137. PlayFlavor(NPC, "", "", "shakefist", 0,0 , Spawn)
  138. Dialog.AddOption( "I'm glad I could help.")
  139. Dialog.Start()
  140. end
  141. function ReservationMade(NPC, Spawn)
  142. SetStepComplete(Spawn, Reservation, 1)
  143. end
  144. function dlg_2_1(NPC, Spawn)
  145. FaceTarget(NPC, Spawn)
  146. Dialog.New(NPC, Spawn)
  147. Dialog.AddDialog("What would you like to hear about?")
  148. Dialog.AddVoiceover("innkeeper_valean/qey_village04/innkeeper001.mp3", 1533786955, 1790782886)
  149. Dialog.AddOption("How can I place an item in my house?", "dlg_2_2")
  150. Dialog.AddOption("What kind of housing is available to me?", "dlg_2_4")
  151. Dialog.AddOption("What is the marketboard for?")
  152. Dialog.AddOption("What is my house for?", "dlg_2_3")
  153. Dialog.AddOption("I see you have many books. ")
  154. Dialog.AddOption("Nothing right now.")
  155. Dialog.Start()
  156. end
  157. function dlg_2_2(NPC, Spawn)
  158. FaceTarget(NPC, Spawn)
  159. conversation = CreateConversation()
  160. AddConversationOption(conversation, "Is this the only place I can live in the city?", "dlg_2_4")
  161. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  162. AddConversationOption(conversation, "That's enough for now, thanks.")
  163. StartConversation(conversation, NPC, Spawn, "To place an item in your house you must first find the item in your inventory, once you have done so right-click on the item and select the [place] option. You will then see a tinted outline of your item in your house, when the item is highlighted green you may place it in that location, if it is highlighted red you cannot.")
  164. end
  165. function dlg_2_3(NPC, Spawn)
  166. FaceTarget(NPC, Spawn)
  167. conversation = CreateConversation()
  168. AddConversationOption(conversation, "Is this the only place I can live in the city?", "dlg_2_4")
  169. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  170. AddConversationOption(conversation, "That's enough for now, thanks.")
  171. StartConversation(conversation, NPC, Spawn, "You will find that your house has many uses, the first of which is the ability to store house items. Each house has a limit to the number of house items you can place in it, so as you gain more possessions you wish to display you will need larger houses to do so.")
  172. end
  173. function dlg_2_4(NPC, Spawn)
  174. FaceTarget(NPC, Spawn)
  175. conversation = CreateConversation()
  176. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  177. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  178. AddConversationOption(conversation, "That's enough for now, thanks.")
  179. StartConversation(conversation, NPC, Spawn, "Many different kinds of housing are available in the city of Qeynos. As a show of appreciation, Antonia Bayle has awarded you a one bedroom house for free at this time.")
  180. end
  181. --[[
  182. PlayFlavor(NPC, "innkeeper_uglar_splinterthumb/qey_village04/innkeeper001.mp3", "", "", 1553251638, 3978555092)
  183. AddConversationOption(conversation, "How can I place an item in my house?", "dlg_7_1")
  184. AddConversationOption(conversation, "What kind of housing is available to me?")
  185. AddConversationOption(conversation, "What is the marketboard for?")
  186. AddConversationOption(conversation, "What is my house for?")
  187. AddConversationOption(conversation, "Nothing right now.")
  188. StartConversation(conversation, NPC, Spawn, "Hello there" .. GetName(Spawn) .. ". what can I help you with?")
  189. --]]