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. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn) --Quest Callout
  19. if math.random(1, 100) <= 70 then
  20. choice = math.random(1,2)
  21. FaceTarget(NPC, Spawn)
  22. if choice ==1 then
  23. 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 lantern. Boots! Perhaps a sword, friend.", "beckon", 2065968741, 2942201215, Spawn)
  24. elseif choice ==2 then
  25. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  26. end
  27. end
  28. end
  29. function hailed(NPC, Spawn)
  30. if GetFactionAmount(Spawn,11) <0 then
  31. FactionChecking(NPC, Spawn, faction)
  32. else
  33. FaceTarget(NPC, Spawn)
  34. Dialog.New(NPC, Spawn)
  35. Dialog.AddDialog("Welcome to my store. You'll notice merchant Kruuprum has setup shop next door. We've actually been working to provide you, the customer, a greater a varaity of wares.")
  36. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin.mp3", 2353063125, 3076810683)
  37. PlayFlavor(NPC, "", "", "bow", 0, 0, Spawn)
  38. if not HasQuest(Spawn, Rats) and not HasCompletedQuest(Spawn,Rats) then
  39. Dialog.AddOption("I do not seek wares. I seek employment.", "RatsStart")
  40. end
  41. if not HasQuest(Spawn, Bats) and GetLevel(Spawn)>=6 then
  42. Dialog.AddOption("You and Kruuprum have a decent selection! Need any help?", "BatsStart")
  43. end
  44. if GetQuestStep(Spawn, Rats)==2 then
  45. Dialog.AddOption("Here are some bugs for you to munch on.", "RatsDone")
  46. end
  47. if GetQuestStep(Spawn, Bats)==2 then
  48. Dialog.AddOption("Here are your five albino pelts.", "BatsStep2")
  49. end
  50. if GetQuestStep(Spawn, Bats)==4 then
  51. Dialog.AddOption("Here are five MORE albino pelts.", "BatsDone")
  52. end
  53. Dialog.AddOption("I'm just browsing. Thank you.")
  54. Dialog.Start()
  55. end
  56. end
  57. function BatsStart(NPC, Spawn)
  58. FaceTarget(NPC, Spawn)
  59. Dialog.New(NPC, Spawn)
  60. 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.")
  61. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin000.mp3",1928749418,2952011097)
  62. PlayFlavor(NPC, "", "", "sniff", 0,0 , Spawn)
  63. Dialog.AddOption("Bleached fur? You mean white?", "BatsBegin")
  64. Dialog.AddOption("Well, that's too bad. I must be going.")
  65. Dialog.Start()
  66. end
  67. function BatsBegin(NPC, Spawn)
  68. FaceTarget(NPC, Spawn)
  69. Dialog.New(NPC, Spawn)
  70. 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?")
  71. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin001.mp3",2715227809,2814889232)
  72. PlayFlavor(NPC, "", "", "agree", 0,0 , Spawn)
  73. Dialog.AddOption("I think I could do that. I'll be back when I have them.", "QuestStart2")
  74. Dialog.AddOption("I don't do caves. Sorry")
  75. Dialog.Start()
  76. end
  77. function BatsStep2(NPC, Spawn)
  78. FaceTarget(NPC, Spawn)
  79. Dialog.New(NPC, Spawn)
  80. 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!")
  81. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin002.mp3",2404713365,4157095705)
  82. PlayFlavor(NPC, "", "", "ponder", 0,0 , Spawn)
  83. Dialog.AddOption("I was headed back that way anyway. I'll return soon.", "BatsUpdate")
  84. Dialog.AddOption("MORE? Oh, fine. I will be back soon.", "BatsUpdate")
  85. Dialog.Start()
  86. end
  87. function BatsDone(NPC, Spawn)
  88. FaceTarget(NPC, Spawn)
  89. Dialog.New(NPC, Spawn)
  90. 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.")
  91. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin003.mp3",898503139,3029193032)
  92. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  93. Dialog.AddOption("The job is done. Good day.", "BatsFinish")
  94. Dialog.AddOption("...Fine. Give me the coin and we're done.", "BatsFinish")
  95. Dialog.Start()
  96. end
  97. function RatsStart(NPC, Spawn)
  98. FaceTarget(NPC, Spawn)
  99. Dialog.New(NPC, Spawn)
  100. 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?")
  101. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin004.mp3",854405291,514627489)
  102. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  103. Dialog.AddOption("I will go collect mystrat tails for you.", "QuestStart1")
  104. Dialog.AddOption("I don't have time to kill rodents.")
  105. Dialog.Start()
  106. end
  107. function RatsDone(NPC, Spawn)
  108. SetStepComplete(Spawn, Rats, 2)
  109. FaceTarget(NPC, Spawn)
  110. Dialog.New(NPC, Spawn)
  111. Dialog.AddDialog("Good work! I knew I could count on you. Take this small reward for your services.")
  112. Dialog.AddVoiceover("voiceover/english/merchant_fevalin/qey_village04/merchantfevalin006.mp3",2345907266,804259931)
  113. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  114. Dialog.AddOption("Thank you.")
  115. Dialog.Start()
  116. end
  117. function QuestStart1 (NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. OfferQuest(NPC, Spawn, Rats)
  120. end
  121. function QuestStart2 (NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. OfferQuest(NPC, Spawn, Bats)
  124. end
  125. function BatsUpdate(NPC, Spawn)
  126. SetStepComplete(Spawn, Bats, 2)
  127. end
  128. function BatsFinish(NPC, Spawn)
  129. SetStepComplete(Spawn, Bats, 4)
  130. end