InnkeeperJerbenSleepwell.lua 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/InnkeeperJerbenSleepwell.lua
  3. Script Purpose : Innkeeper Jerben Sleepwell <Housing>
  4. Script Author : Dorbin
  5. Script Date : 07.02.2022
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  11. ProvidesQuest(NPC,5364)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function InRange(NPC, Spawn)
  17. if GetFactionAmount(Spawn,11)<0 then
  18. FaceTarget(NPC, Spawn)
  19. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  20. else
  21. if HasCompletedQuest(Spawn,5364)then
  22. local chance = math.random(0, 100)
  23. if chance <= 80 then
  24. PlayFlavor(NPC, "", "", "tapfoot", 0, 0, Spawn, 0)
  25. end
  26. elseif not HasQuest(Spawn, 5364) and not HasCompletedQuest(Spawn,5364)then
  27. local chance = math.random(0, 100)
  28. if chance <= 80 then
  29. FaceTarget(NPC, Spawn)
  30. PlayFlavor(NPC, "voiceover/english/innkeeper_jerben_sleepwell/qey_village02/100_innkeeper_callout_ce8f52eb.mp3", "It's been so long since I've had one of my wife's special desserts! I want some crunchies! Will you help me get more crunchies?", "sigh", 943990017, 651455380, Spawn)
  31. end
  32. end
  33. end
  34. end
  35. function hailed(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. if GetFactionAmount(Spawn,11)<0 then
  38. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  39. elseif HasCompletedQuest(Spawn,5346)then
  40. dlg_2_1(NPC, Spawn)
  41. else
  42. Dialog1(NPC, Spawn)
  43. end
  44. end
  45. function Dialog1(NPC, Spawn)
  46. FaceTarget(NPC, Spawn)
  47. Dialog.New(NPC, Spawn)
  48. PlayFlavor(NPC, "", "", "pout", 0, 0, Spawn)
  49. Dialog.AddDialog("Use to be a more pleasant place. My lovely wife would bake white batwing crunchies-- everyone loved those crunchy treats, but we've run out of albino batwings!")
  50. Dialog.AddVoiceover("voiceover/english/innkeeper_jerben_sleepwell/qey_village02/jerbensleepwell000.mp3", 2788482206, 4149980298)
  51. if not HasCompletedQuest (Spawn, 5364) and not HasQuest (Spawn, 5364) then
  52. Dialog.AddOption("I think I could help you out there.", "Dialog2")
  53. end
  54. if GetQuestStep (Spawn, 5346)==2 then
  55. Dialog.AddOption("I've returned with the wings you needed, but they don't look very tasty.","Delivered")
  56. end
  57. Dialog.AddOption("Gee, that's a shame.")
  58. Dialog.AddOption("I would actually like to know about inn rooms.","dlg_2_1")
  59. Dialog.Start()
  60. end
  61. function Dialog2(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. PlayFlavor(NPC, "", "", "whome", 0, 0, Spawn)
  65. Dialog.AddDialog("Really? You'd help me, friend? That's wonderful. I've not had the crunchies in so long; I forget what they taste like. You'll find the albino bats living in the caves near here. Bring back several wings and I'll be forever in your debt.")
  66. Dialog.AddVoiceover("voiceover/english/innkeeper_jerben_sleepwell/qey_village02/jerbensleepwell001.mp3", 4196072373, 1311386681)
  67. Dialog.AddOption("I'll see what I can do.", "QuestBegin")
  68. Dialog.Start()
  69. end
  70. function QuestBegin (NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. OfferQuest(NPC, Spawn, 5364)
  73. end
  74. function Delivered(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. Dialog.New(NPC, Spawn)
  77. SetStepComplete(Spawn, 5364, 2)
  78. PlayFlavor(NPC, "", "", "cheer", 0, 0, Spawn)
  79. Dialog.AddDialog("Oh, this is wonderful! Really, these were my favorite treats as a child, so they bring back fond memories. I'm forever indebted to you. Please let me pay you a few coins for your trouble.")
  80. Dialog.AddVoiceover("voiceover/english/innkeeper_jerben_sleepwell/qey_village02/jerbensleepwell002.mp3", 3830347004, 2175613137)
  81. Dialog.AddOption("Hey, a little coin is always appreciated. Thanks!")
  82. Dialog.Start()
  83. end
  84. -- Innkeeper Dialog
  85. function dlg_2_1(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. conversation = CreateConversation()
  88. PlayFlavor(NPC, "innkeeper_millbanks/qey_village06/innkeeper001.mp3", "", "", 4001228290, 3829134373, Spawn)
  89. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  90. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  91. AddConversationOption(conversation, "How do I sell items using my marketboard?", "dlg_2_5")
  92. AddConversationOption(conversation, "Are there other places I can live in the city?", "dlg_2_4")
  93. AddConversationOption(conversation, "Nevermind for right now, thanks.")
  94. if HasCompletedQuest(Spawn,5346)then
  95. StartConversation(conversation, NPC, Spawn, "Thanks for the wings. They'll make the perfect crunchies!")
  96. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  97. else
  98. StartConversation(conversation, NPC, Spawn, "What would you like to know?")
  99. end
  100. end
  101. function dlg_2_2(NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. conversation = CreateConversation()
  104. -- PlayFlavor(NPC, "innkeeper_uglar_splinterthumb/qey_village06/innkeeper002.mp3", "", "", 3750108879, 603350042, Spawn)
  105. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  106. AddConversationOption(conversation, "How do I sell items using my marketboard?", "dlg_2_5")
  107. AddConversationOption(conversation, "Is this the only place I can live in the city?", "dlg_2_4")
  108. AddConversationOption(conversation, "That's enough for now, thanks.")
  109. 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.")
  110. end
  111. function dlg_2_3(NPC, Spawn)
  112. FaceTarget(NPC, Spawn)
  113. conversation = CreateConversation()
  114. -- PlayFlavor(NPC, "innkeeper_uglar_splinterthumb/qey_village06/innkeeper007.mp3", "", "", 1015751749, 2650517021, Spawn)
  115. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  116. AddConversationOption(conversation, "How do I sell items using my marketboard?", "dlg_2_5")
  117. AddConversationOption(conversation, "Is this the only place I can live in the city?", "dlg_2_4")
  118. AddConversationOption(conversation, "That's enough for now, thanks.")
  119. 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.")
  120. end
  121. function dlg_2_4(NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. conversation = CreateConversation()
  124. --PlayFlavor(NPC, "innkeeper_uglar_splinterthumb/qey_village06/innkeeper003.mp3", "", "", 3477497917, 3032281679, Spawn)
  125. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  126. AddConversationOption(conversation, "How do I sell items using my marketboard?", "dlg_2_5")
  127. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  128. AddConversationOption(conversation, "That's enough for now, thanks.")
  129. 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.")
  130. end
  131. function dlg_2_5(NPC, Spawn)
  132. FaceTarget(NPC, Spawn)
  133. conversation = CreateConversation()
  134. AddConversationOption(conversation, "What can I use my house for?", "dlg_2_3")
  135. AddConversationOption(conversation, "How do I place furniture in my home?", "dlg_2_2")
  136. AddConversationOption(conversation, "Are there other places I can live in the city?", "dlg_2_4")
  137. AddConversationOption(conversation, "That's enough for now, thanks.")
  138. StartConversation(conversation, NPC, Spawn, "The marketboard is a house item, similar to books, beds, pets and other such items. What sets the marketboard apart from the rest however is that once your marketboard is mounted on a wall in your home you can use it to sell items to other citizens of Qeynos. These items can be purchased by your fellow citizens at a Broker. Brokers can be found in all primary districts of the city as well as in the Tradeskill wholesalers.")
  139. end
  140. -- raw_conversations
  141. -- PlayFlavor(NPC, "jerben_sleepwell/qey_village02/jerbensleepwell003.mp3", "", "hail", 2393164093, 2811776206, Spawn)
  142. -- PlayFlavor(NPC, "voiceover/english/innkeeper_jerben_sleepwell/qey_village02/jerbensleepwell.mp3", "", "wink", 2091561802, 1214350847, Spawn)