Fevalin.lua 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. --[[
  2. Script Name : SpawnScripts/Castleview/Fevalin.lua
  3. Script Purpose : Fevalin <Provisioner>
  4. Script Author : Dorbin
  5. Script Date : 2022.01.28
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Rats = 5464
  10. local Bats = 5463
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC, Rats)
  14. SetInfoStructString(NPC, "action_state", "tapfoot")
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn) --Quest Callout
  20. if math.random(1, 100) <= 70 then
  21. choice = math.random(1,2)
  22. FaceTarget(NPC, Spawn)
  23. if choice ==1 then
  24. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/100_merchant_right_fevalin_callout_7243eb33.mp3", "Step up. Don't be shy. I know an adventurer like you needs something. A new lantern. Boots! Perhaps a sword, friend.", "beckon", 2065968741, 2942201215, Spawn)
  25. elseif choice ==2 then
  26. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  27. end
  28. end
  29. end
  30. function hailed(NPC, Spawn)
  31. if GetFactionAmount(Spawn,11) <0 then
  32. FactionChecking(NPC, Spawn, faction)
  33. else
  34. FaceTarget(NPC, Spawn)
  35. Dialog.New(NPC, Spawn)
  36. Dialog.AddDialog("Welcome to my store. You'll notice merchant Kruuprum has setup shop next door. We've actually been working to bring you, the customer, a greater a variety of wares.")
  37. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin.mp3", 2353063125, 3076810683)
  38. PlayFlavor(NPC, "", "", "bow", 0, 0, Spawn)
  39. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn,Rats) then
  40. Dialog.AddOption("I do not seek wares. I seek employment.", "RatsStart")
  41. end
  42. if not HasQuest(Spawn, Bats) and GetLevel(Spawn)>=6 then
  43. Dialog.AddOption("You and Kruuprum have a decent selection! Need any help?", "BatsStart")
  44. end
  45. if GetQuestStep(Spawn, Rats)==2 then
  46. Dialog.AddOption("Here are the tails you requested from Oakmyst.", "RatsDone")
  47. end
  48. if GetQuestStep(Spawn, Bats)==2 then
  49. Dialog.AddOption("Here are your five albino pelts.", "BatsStep2")
  50. end
  51. if GetQuestStep(Spawn, Bats)==4 then
  52. Dialog.AddOption("Here are five MORE albino pelts.", "BatsDone")
  53. end
  54. Dialog.AddOption("I'm just browsing. Thank you.")
  55. Dialog.Start()
  56. end
  57. end
  58. function BatsStart(NPC, Spawn)
  59. FaceTarget(NPC, Spawn)
  60. Dialog.New(NPC, Spawn)
  61. Dialog.AddDialog("Yes. Between the two of us, we stock everything a budding adventurer like you desires. Although unfortunately I've had no luck getting some quality bleached fur.")
  62. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin000.mp3",1928749418,2952011097)
  63. PlayFlavor(NPC, "", "", "sniff", 0,0 , Spawn)
  64. Dialog.AddOption("Bleached fur? You mean white?", "BatsBegin")
  65. Dialog.AddOption("Well, that's too bad. I must be going.")
  66. Dialog.Start()
  67. end
  68. function BatsBegin(NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. Dialog.New(NPC, Spawn)
  71. Dialog.AddDialog("Yes! That's precisely what I mean. You see, only one animal exists with fur fine enough for my needs. At least, a white animal. The albino bats in the caves near Baubbleshire have the softest coats I've laid my hands on. Now how about you run and fetch me some fur from these silky creatures?")
  72. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin001.mp3",2715227809,2814889232)
  73. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  74. Dialog.AddOption("I think I could do that. I'll be back when I have them.", "QuestStart2")
  75. Dialog.AddOption("I don't do caves. Sorry")
  76. Dialog.Start()
  77. end
  78. function BatsStep2(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("Oh... You know, I'm really sorry about this, but I'm going to have you go ahead and get me some more. That would be great. Now go along and get them. I'll go ahead and hold the ones you just brought me. I wouldn't want them to get dirty while trapsing through those dirty caverns!")
  82. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin002.mp3",2404713365,4157095705)
  83. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  84. Dialog.AddOption("I was headed back that way anyway. I'll return soon.", "BatsUpdate")
  85. Dialog.AddOption("MORE? Oh, fine. I will be back soon.", "BatsUpdate")
  86. Dialog.Start()
  87. end
  88. function BatsDone(NPC, Spawn)
  89. FaceTarget(NPC, Spawn)
  90. Dialog.New(NPC, Spawn)
  91. Dialog.AddDialog("Grand! These will do nicely. Although they are a little dirty. I'm afraid I must knock a bit off your reward. Here is some silver for your efforts.")
  92. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin003.mp3",898503139,3029193032)
  93. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  94. Dialog.AddOption("The job is done. Good day.", "BatsFinish")
  95. Dialog.AddOption("...Fine. Give me the coin and we're done.", "BatsFinish")
  96. Dialog.Start()
  97. end
  98. function RatsStart(NPC, Spawn)
  99. FaceTarget(NPC, Spawn)
  100. Dialog.New(NPC, Spawn)
  101. Dialog.AddDialog("You arrive at a good time, my friend. I could use a helping hand. I need a large quantity of mystail rat tails, but I cannot leave my wares alone at this stand. Will you collect the tails?")
  102. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin004.mp3",854405291,514627489)
  103. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  104. Dialog.AddOption("I will go collect mystrat tails for you.", "QuestStart1")
  105. Dialog.AddOption("I don't have time to kill rodents.")
  106. Dialog.Start()
  107. end
  108. function RatsDone(NPC, Spawn)
  109. SetStepComplete(Spawn, Rats, 2)
  110. FaceTarget(NPC, Spawn)
  111. Dialog.New(NPC, Spawn)
  112. Dialog.AddDialog("Good work! I knew I could count on you. Take this small reward for your services.")
  113. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin006.mp3",2345907266,804259931)
  114. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  115. Dialog.AddOption("Thank you.")
  116. Dialog.Start()
  117. end
  118. function QuestStart1 (NPC, Spawn)
  119. FaceTarget(NPC, Spawn)
  120. OfferQuest(NPC, Spawn, Rats)
  121. end
  122. function QuestStart2 (NPC, Spawn)
  123. FaceTarget(NPC, Spawn)
  124. OfferQuest(NPC, Spawn, Bats)
  125. end
  126. function BatsUpdate(NPC, Spawn)
  127. SetStepComplete(Spawn, Bats, 2)
  128. end
  129. function BatsFinish(NPC, Spawn)
  130. SetStepComplete(Spawn, Bats, 4)
  131. end