9
3

InnkeeperValean.lua 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. SetInfoStructString(NPC, "action_state", "ponder")
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function InRange (NPC,Spawn)
  23. if not HasQuest(Spawn, LostBook) and not HasCompletedQuest(Spawn, LostBooks) then
  24. if math.random(1, 100) <= 70 then
  25. 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)
  26. end
  27. else
  28. if math.random(1, 100) <= 60 then
  29. local choice = MakeRandomInt(1,5)
  30. if choice == 1 then
  31. 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)
  32. elseif choice == 2 then
  33. 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)
  34. elseif choice == 3 then
  35. 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)
  36. elseif choice == 4 then
  37. 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
  38. end
  39. end
  40. end
  41. --
  42. function hailed(NPC, Spawn)
  43. FaceTarget(NPC, Spawn)
  44. Dialog.New(NPC, Spawn)
  45. 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?")
  46. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean.mp3", 3631971111,2641145010)
  47. PlayFlavor(NPC, "", "", "bow",0,0, Spawn)
  48. if GetQuestStep (Spawn, Delivery) == 1 then
  49. Dialog.AddOption("Ganla Dindlenod wants you to take a look at this book.", "BookDelivery")
  50. end
  51. if GetQuestStep (Spawn, Dinner) == 1 then
  52. 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")
  53. end
  54. if GetQuestStep (Spawn, Reservation) == 1 then
  55. Dialog.AddOption("I need to make a room reservation for Taneran.", "KnowTaneran")
  56. end
  57. if not HasQuest(Spawn,Books) and not HasCompletedQuest(Spawn,Books) then
  58. Dialog.AddOption("You have a great number of books in your collection.", "BookCollection")
  59. end
  60. if GetQuestStep (Spawn, Books) == 2 then
  61. Dialog.AddOption("I found your books being sold in the catacombs.", "FoundBooks")
  62. end
  63. if GetQuestStep (Spawn, LostBook) == 2 then
  64. Dialog.AddOption("Faeadaen mentioned she left a book of Arbos here. Have you seen it?", "Arbos")
  65. end
  66. Dialog.AddOption("Yes.", "dlg_2_1")
  67. Dialog.AddOption("I am not interested in a room at this time.")
  68. Dialog.Start()
  69. end
  70. function Arbos(NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. conversation = CreateConversation()
  73. AddConversationOption(conversation, "Alright. I'll check the shelves for the book.")
  74. 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.")
  75. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  76. end
  77. function BookDelivery(NPC, Spawn)
  78. SetStepComplete(Spawn, Delivery, 1)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. 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.")
  82. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean005.mp3", 3924782316,102930417)
  83. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  84. Dialog.AddOption( "I'll let Ganla know. I hope it contains something good!")
  85. Dialog.Start()
  86. end
  87. function NoDinner(NPC, Spawn)
  88. SetStepComplete(Spawn, Dinner, 1)
  89. FaceTarget(NPC, Spawn)
  90. Dialog.New(NPC, Spawn)
  91. Dialog.AddDialog("Again!? That froglok should hire more people so poor Faeadaen isn't worked to the bone. Well, thanks for letting me know. I guess I'll dine alone tonight.")
  92. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean000.mp3", 4169629165,2563079815)
  93. PlayFlavor(NPC, "", "", "sigh", 0,0 , Spawn)
  94. Dialog.AddOption( "There is always tomorrow.")
  95. Dialog.Start()
  96. end
  97. function KnowTaneran(NPC, Spawn)
  98. FaceTarget(NPC, Spawn)
  99. Dialog.New(NPC, Spawn)
  100. 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.")
  101. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean001.mp3", 3017286284,4228062292)
  102. PlayFlavor(NPC, "", "", "nod", 0,0 , Spawn)
  103. Dialog.AddOption("That seems like their business, not mine.", "UpdateReservation")
  104. Dialog.AddOption("I don't really know them well.", "UpdateReservation")
  105. Dialog.Start()
  106. end
  107. function UpdateReservation(NPC, Spawn)
  108. FaceTarget(NPC, Spawn)
  109. Dialog.New(NPC, Spawn)
  110. Dialog.AddDialog("Pardon my indiscretion, friend. I assumed because you're making his reservation that you were a close friend of Taneran. He and I speak sometimes when he retires for the night ... please, don't mention this to the lady... I shall see that his room is ready...")
  111. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean002.mp3", 1569016427,2379789272)
  112. PlayFlavor(NPC, "", "", "boggle", 0,0 , Spawn)
  113. Dialog.AddOption( "I will let her know.", "ReservationMade")
  114. Dialog.AddOption( "I must congratulation them!", "ReservationMade")
  115. Dialog.AddOption( "Perhaps don't assume next time. Thank you.", "ReservationMade")
  116. Dialog.Start()
  117. end
  118. function BookCollection(NPC, Spawn)
  119. FaceTarget(NPC, Spawn)
  120. Dialog.New(NPC, Spawn)
  121. 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.")
  122. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean003.mp3", 1990579767,1971786194)
  123. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  124. Dialog.AddOption( "If I see them down there, I'll let you know.", "BookLook")
  125. Dialog.AddOption( "The catacombs? Ew. No.")
  126. Dialog.Start()
  127. end
  128. function BookLook (NPC, Spawn)
  129. FaceTarget(NPC, Spawn)
  130. OfferQuest(NPC, Spawn, Books)
  131. end
  132. function FoundBooks(NPC, Spawn)
  133. SetStepComplete(Spawn, Books, 2)
  134. FaceTarget(NPC, Spawn)
  135. Dialog.New(NPC, Spawn)
  136. 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.")
  137. Dialog.AddVoiceover("voiceover/english/innkeeper_valean/qey_village04/innkeepervalean004.mp3", 4073559800,1910490855)
  138. PlayFlavor(NPC, "", "", "shakefist", 0,0 , Spawn)
  139. Dialog.AddOption( "I'm glad I could help.")
  140. Dialog.Start()
  141. end
  142. function ReservationMade(NPC, Spawn)
  143. SetStepComplete(Spawn, Reservation, 1)
  144. end
  145. function dlg_2_1(NPC, Spawn)
  146. FaceTarget(NPC, Spawn)
  147. Dialog.New(NPC, Spawn)
  148. Dialog.AddDialog("What would you like to hear about?")
  149. Dialog.AddVoiceover("innkeeper_valean/qey_village04/innkeeper001.mp3", 1533786955, 1790782886)
  150. Dialog.AddOption("How can I place an item in my house?", "dlg_2_2")
  151. Dialog.AddOption("What kind of housing is available to me?", "dlg_2_4")
  152. Dialog.AddOption("What is the marketboard for?")
  153. Dialog.AddOption("What is my house for?", "dlg_2_3")
  154. Dialog.AddOption("I see you have many books. ")
  155. Dialog.AddOption("Nothing right now.")
  156. Dialog.Start()
  157. end
  158. function dlg_2_2(NPC, Spawn)
  159. FaceTarget(NPC, Spawn)
  160. conversation = CreateConversation()
  161. AddConversationOption(conversation, "Is this the only place I can live in the city?", "dlg_2_4")
  162. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  163. AddConversationOption(conversation, "That's enough for now, thanks.")
  164. 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.")
  165. end
  166. function dlg_2_3(NPC, Spawn)
  167. FaceTarget(NPC, Spawn)
  168. conversation = CreateConversation()
  169. AddConversationOption(conversation, "Is this the only place I can live in the city?", "dlg_2_4")
  170. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  171. AddConversationOption(conversation, "That's enough for now, thanks.")
  172. 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.")
  173. end
  174. function dlg_2_4(NPC, Spawn)
  175. FaceTarget(NPC, Spawn)
  176. conversation = CreateConversation()
  177. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  178. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  179. AddConversationOption(conversation, "That's enough for now, thanks.")
  180. 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.")
  181. end