MadamVi.lua 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. --[[
  2. Script Name : SpawnScripts/TheCommonlands/MadamVi.lua
  3. Script Purpose : Madam Vi
  4. Script Author : premierio015
  5. Script Date : 2021.17.05
  6. Script Notes :
  7. --]]
  8. local QuenchingTheirThirst = 5222
  9. local FarFromHome = 5223
  10. local NoRiskNoReward = 5224
  11. local SeerStone = 5225
  12. function InRange(NPC, Spawn)
  13. end
  14. function spawn(NPC)
  15. ProvidesQuest(NPC, QuenchingTheirThirst)
  16. ProvidesQuest(NPC, FarFromHome)
  17. ProvidesQuest(NPC, NoRiskNoReward)
  18. ProvidesQuest(NPC, SeerStone)
  19. SetPlayerProximityFunction(NPC, 10, "InRange")
  20. end
  21. function respawn(NPC)
  22. spawn(NPC)
  23. end
  24. function hailed(NPC,Spawn)
  25. FaceTarget(NPC, Spawn)
  26. if not HasQuest(Spawn, QuenchingTheirThirst) and not HasCompletedQuest(Spawn, QuenchingTheirThirst) then
  27. local conversation = CreateConversation()
  28. AddConversationOption(conversation, "What assistance do you require?", "Option1")
  29. AddConversationOption(conversation, "I'm busy at the moment.")
  30. StartConversation(conversation, NPC, Spawn, "I need some assistance. Would you be willing to aid me?")
  31. elseif GetQuestStep(Spawn, QuenchingTheirThirst) == 1 or GetQuestStep(Spawn, QuenchingTheirThirst) == 2 or GetQuestStep(Spawn, QuenchingTheirThirst) == 3 or GetQuestStep(Spawn, FarFromHome) == 1 or GetQuestStep(Spawn, NoRiskNoReward) == 1 or GetQuestStep(Spawn, SeerStone) == 1 or GetQuestStep(Spawn, SeerStone) == 2 or GetQuestStep(Spawn, SeerStone) == 3 then
  32. QuestProgress(NPC, Spawn)
  33. elseif GetQuestStep(Spawn, QuenchingTheirThirst) == 4 or GetQuestStep(Spawn, FarFromHome) == 2 or GetQuestStep(Spawn, NoRiskNoReward) == 2 or GetQuestStep(Spawn, SeerStone) == 4 then
  34. QuestFinish(NPC, Spawn)
  35. elseif HasCompletedQuest(Spawn, QuenchingTheirThirst) and not HasCompletedQuest(Spawn, FarFromHome) then
  36. Option3(NPC, Spawn)
  37. elseif HasCompletedQuest(Spawn, QuenchingTheirThirst) and HasCompletedQuest(Spawn, FarFromHome) and not HasCompletedQuest(Spawn, NoRiskNoReward) then
  38. Option7(NPC, Spawn)
  39. elseif HasCompletedQuest(Spawn, QuenchingTheirThirst) and HasCompletedQuest(Spawn, FarFromHome) and HasCompletedQuest(Spawn, NoRiskNoReward) and not HasCompletedQuest(Spawn, SeerStone) then
  40. Option11(NPC, Spawn)
  41. elseif HasCompletedQuest(Spawn, QuenchingTheirThirst) and HasCompletedQuest(Spawn, FarFromHome) and HasCompletedQuest(Spawn, NoRiskNoReward) and HasCompletedQuest(Spawn, SeerStone) then
  42. PlayFlavor(NPC, "", "Wonderful to see you, thanks again for all your help.", "", 0, 0, Spawn)
  43. end
  44. end
  45. function Option1(NPC, Spawn)
  46. FaceTarget(NPC, Spawn)
  47. local conversation = CreateConversation()
  48. AddConversationOption(conversation, "Sure.", "offer")
  49. AddConversationOption(conversation, "Not right now.")
  50. StartConversation(conversation, NPC, Spawn, "The heat out here is ridiculous and I am parched. I would do anything for some nice cool water. The water around here gets so filthy from the livestock. Even as hot as it is, I can't just drink any water, you know? Do you think you could go out and fill each of these flasks with clean water from the lake and river for me? Oh, and I will also need one of them filled from the sea. Mooshga always needs more salt for curing her specialties.")
  51. end
  52. function Quest_Finish(NPC, Spawn)
  53. FaceTarget(NPC, Spawn)
  54. local conversation = CreateConversation()
  55. if GetQuestStep(Spawn, QuenchingTheirThirst) == 4 then
  56. AddConversationOption(conversation, "I have filled the flasks for you, Madam.", "Option2")
  57. elseif GetQuestStep(Spawn, FarFromHome) == 2 then
  58. AddConversationOption(conversation, "I was able to find your friends. They were very grateful for the water.", "Option6")
  59. elseif GetQuestStep(Spawn, NoRiskNoReward) == 2 then
  60. AddConversationOption(conversation, "I was able to find your stone, Madam.", "Option10")
  61. elseif GetQuestStep(Spawn, SeerStone) == 4 then
  62. AddConversationOption(conversation, "I have the things you need for your Seer Stone, Madam.", "Option15")
  63. end
  64. AddConversationOption(conversation, "Nothing right now.")
  65. StartConversation(conversation, NPC, Spawn, "Hello again. Any news?")
  66. end
  67. function Option2(NPC, Spawn)
  68. SetStepComplete(Spawn, QuenchingTheirThirst, 4)
  69. FaceTarget(NPC, Spawn)
  70. local conversation = CreateConversation()
  71. AddConversationOption(conversation, "You're welcome, Madam.")
  72. StartConversation(conversation, NPC, Spawn, "Excellent work!")
  73. end
  74. function Option3(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. local conversation = CreateConversation()
  77. AddConversationOption(conversation, "Actually, I do.", "Option4")
  78. AddConversationOption(conversation, "Not for you.")
  79. StartConversation(conversation, NPC, Spawn, "Hello again. Do you have any further time to spare?")
  80. end
  81. function Option4(NPC, Spawn)
  82. FaceTarget(NPC, Spawn)
  83. local conversation = CreateConversation()
  84. AddConversationOption(conversation, "No problem, where are they?", "Option5")
  85. AddConversationOption(conversation, "I care not for your friends.")
  86. StartConversation(conversation, NPC, Spawn, "A section of my entourage seems to be lost out there. I need you to find them, give them the water you collected earlier, and relay their location to me.")
  87. end
  88. function Option5(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. local conversation = CreateConversation()
  91. AddConversationOption(conversation, "I will find them.", "offer2")
  92. StartConversation(conversation, NPC, Spawn, "Head out to the northwest. They have been missing for quite some time.")
  93. end
  94. function Option6(NPC, Spawn)
  95. SetStepComplete(Spawn, FarFromHome, 2)
  96. FaceTarget(NPC, Spawn)
  97. local conversation = CreateConversation()
  98. AddConversationOption(conversation, "I agree.")
  99. StartConversation(conversation, NPC, Spawn, "Great news! Nothing like an ice cold drink on a hot day.")
  100. end
  101. function Option7(NPC, Spawn)
  102. FaceTarget(NPC, Spawn)
  103. local conversation = CreateConversation()
  104. AddConversationOption(conversation, "It was my pleasure, but you seem distracted. Do you require further assistance?", "Option8")
  105. AddConversationOption(conversation, "I did do great, didn't I? I'll be off now.")
  106. StartConversation(conversation, NPC, Spawn, "Hello, friend. My companions are rehydrated and back to themselves, thanks to you.")
  107. end
  108. function Option8(NPC, Spawn)
  109. FaceTarget(NPC, Spawn)
  110. local conversation = CreateConversation()
  111. AddConversationOption(conversation, "I meant no offense. Is there anything I can do to rid you of this distraction?", "Option9")
  112. AddConversationOption(conversation, "I think you need to get out of the sun. Goodbye.")
  113. StartConversation(conversation, NPC, Spawn, "Wha..distracted? Hmm, well I suppose you are correct, but please do keep your observations to yourself in the future. ")
  114. end
  115. function Option9(NPC, Spawn)
  116. FaceTarget(NPC, Spawn)
  117. local conversation = CreateConversation()
  118. AddConversationOption(conversation, "I will find the gem for you.", "offer3")
  119. AddConversationOption(conversation, "Wailing Caves? Are you insane?!")
  120. StartConversation(conversation, NPC, Spawn, "There is a gem that I truly desire which has evaded me. I heard that it can be found by breaking open clumps of rocks inside the Wailing Caves to the west. Look for dull stone outcroppings near the vibrant blue rocks found inside.")
  121. end
  122. function Option10(NPC, Spawn)
  123. SetStepComplete(Spawn, NoRiskNoReward, 2)
  124. FaceTarget(NPC, Spawn)
  125. local conversation = CreateConversation()
  126. AddConversationOption(conversation, "You're welcome.")
  127. StartConversation(conversation, NPC, Spawn, "Oh yes, this is just what I needed. Look here, the gem is right inside. Oh, it's just gorgeous, and will work perfectly for what I have in mind. Thank you.")
  128. end
  129. function Option11(NPC, Spawn)
  130. FaceTarget(NPC, Spawn)
  131. local conversation = CreateConversation()
  132. AddConversationOption(conversation, "Some, yes.", "Option12")
  133. AddConversationOption(conversation, "No, nothing at all. I better go.")
  134. StartConversation(conversation, NPC, Spawn, "You have certainly proven yourself, and it is I who am honored. Tell me, do you know anything of mage craft?")
  135. end
  136. function Option12(NPC, Spawn)
  137. FaceTarget(NPC, Spawn)
  138. local conversation = CreateConversation()
  139. AddConversationOption(conversation, "Ahh, so that is what the gem samples were for.", "Option13")
  140. AddConversationOption(conversation, "I am sick of your ego. Goodbye.")
  141. StartConversation(conversation, NPC, Spawn, "There are certain items that, when created, can help a mage focus his or her power. These items enhance my already impressive gift of Sight.")
  142. end
  143. function Option13(NPC, Spawn)
  144. FaceTarget(NPC, Spawn)
  145. local conversation = CreateConversation()
  146. AddConversationOption(conversation, "I am very interested. Where do I look?", "Option14")
  147. AddConversationOption(conversation, "No, not right now. Maybe later.")
  148. StartConversation(conversation, NPC, Spawn, "Exactly. You are quite intuitive. The gem you retrieved for me is in itself not enough to create the quality item I desire. Would you be interested in fetching the rest of the components I need?")
  149. end
  150. function Option14(NPC, Spawn)
  151. FaceTarget(NPC, Spawn)
  152. local conversation = CreateConversation()
  153. AddConversationOption(conversation, "I'll be off then.", "offer4")
  154. AddConversationOption(conversation, "I don't think I will help.")
  155. StartConversation(conversation, NPC, Spawn, "To finish my Seer Stone, I will need some components that you can gather for me from different beasts around the Commonlands. I will need some bone dust, a few water glands and, just for good measure, some sparkly bits.")
  156. end
  157. function Option15(NPC, Spawn)
  158. SetStepComplete(Spawn, SeerStone, 4)
  159. FaceTarget(NPC, Spawn)
  160. local conversation = CreateConversation()
  161. AddConversationOption(conversation, "You're welcome, Madam.")
  162. StartConversation(conversation, NPC, Spawn, "Oh, thank you... I can complete my stone, at long last!")
  163. end
  164. function offer(NPC, Spawn)
  165. OfferQuest(NPC, Spawn, QuenchingTheirThirst )
  166. end
  167. function offer2(NPC, Spawn)
  168. OfferQuest(NPC, Spawn, FarFromHome)
  169. end
  170. function offer3(NPC, Spawn)
  171. OfferQuest(NPC, Spawn, NoRiskNoReward)
  172. end
  173. function offer4(NPC, Spawn)
  174. OfferQuest(NPC, Spawn, SeerStone)
  175. end
  176. function QuestProgress(NPC, Spawn)
  177. FaceTarget(NPC, Spawn)
  178. local conversation = CreateConversation()
  179. AddConversationOption(conversation, "Not yet. Patience, my lady.")
  180. StartConversation(conversation, NPC, Spawn, "Have you completed your task?")
  181. end