Fevalin.lua 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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 : Auto-Generated Conversation from PacketParser Data
  7. --]]
  8. local Rats = 5464
  9. local Bats = 5463
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Rats)
  13. ProvidesQuest(NPC, Bats)
  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. FaceTarget(NPC, Spawn)
  31. conversation = CreateConversation()
  32. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin.mp3", "", "bow", 2353063125, 3076810683, Spawn)
  33. if not HasQuest(Spawn, Rats) then
  34. AddConversationOption(conversation, "Have any jobs I can do?", "RatsStart")
  35. end
  36. if not HasQuest(Spawn, Bats) and GetLevel(Spawn)>=7 then
  37. AddConversationOption(conversation, "You and Kruuprum have a decent selection! Need any help?", "BatsStart")
  38. end
  39. if GetQuestStep(Spawn, Rats)==2 then
  40. AddConversationOption(conversation, "Here are some bugs for you to munch on.", "RatsDone")
  41. end
  42. if GetQuestStep(Spawn, Bats)==2 then
  43. AddConversationOption(conversation, "Here are your five albino pelts.", "BatsStep2")
  44. end
  45. if GetQuestStep(Spawn, Bats)==4 then
  46. AddConversationOption(conversation, "Here are five MORE albino pelts.", "BatsDone")
  47. end
  48. AddConversationOption(conversation, "I'm just browsing. Thank you.")
  49. StartConversation(conversation, NPC, Spawn, "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.")
  50. end
  51. function BatsStart(NPC, Spawn)
  52. conversation = CreateConversation()
  53. AddConversationOption(conversation, "You mean... albino fur?", "BatsBegin")
  54. AddConversationOption(conversation, "Well, that's too bad. I must be going.")
  55. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin000.mp3","","agree",1928749418,2952011097,Spawn)
  56. StartConversation(conversation, NPC, Spawn, "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. ")
  57. end
  58. function BatsBegin(NPC, Spawn)
  59. conversation = CreateConversation()
  60. AddConversationOption(conversation, "I'll look for some albino furs for you.", "QuestStart2")
  61. AddConversationOption(conversation, "I don't do caves. Sorry")
  62. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin001.mp3","","agree",2715227809,2814889232,Spawn)
  63. StartConversation(conversation, NPC, Spawn, "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? ")
  64. end
  65. function BatsStep2(NPC, Spawn)
  66. conversation = CreateConversation()
  67. AddConversationOption(conversation, "I was headed back that way anyway. I'll return soon.", "BatsUpdate")
  68. AddConversationOption(conversation, "MORE? Oh, fine. I will be back soon.", "BatsUpdate")
  69. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin002.mp3","","ponder",2404713365,4157095705,Spawn)
  70. StartConversation(conversation, NPC, Spawn, "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!")
  71. end
  72. function BatsDone(NPC, Spawn)
  73. conversation = CreateConversation()
  74. AddConversationOption(conversation, "I'm sorry they weren't to your liking. Thanks anyway.", "BatsFinish")
  75. AddConversationOption(conversation, "...Fine. Give me the coin and we're done.", "BatsFinish")
  76. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin003.mp3","","Thank",898503139,3029193032,Spawn)
  77. StartConversation(conversation, NPC, Spawn, "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.")
  78. end
  79. function RatsStart(NPC, Spawn)
  80. conversation = CreateConversation()
  81. AddConversationOption(conversation, "I will go collect mystrat tails for you.", "RatsStart2")
  82. AddConversationOption(conversation, "I don't have time to kill rodents.")
  83. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin004.mp3","","",854405291,514627489,Spawn)
  84. StartConversation(conversation, NPC, Spawn, "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?")
  85. end
  86. function RatsStart2(NPC, Spawn)
  87. conversation = CreateConversation()
  88. AddConversationOption(conversation, "I'm off to Oakmyst Forest!", "QuestBegin1")
  89. AddConversationOption(conversation, "On second thought, nevermind.")
  90. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin005.mp3","","agree",25404249,2050252222,Spawn)
  91. StartConversation(conversation, NPC, Spawn, "Thanks for pitching in. Every bundle of tails helps! You'll' find the mystail rats in Oakmyst Forest. Happy hunting!")
  92. end
  93. function RatsDone(NPC, Spawn)
  94. conversation = CreateConversation()
  95. AddConversationOption(conversation, "Thank you.", "RewardRats")
  96. PlayFlavor(NPC, "voiceover/english/merchant_fevalin/qey_village04/merchantfevalin006.mp3","","thank",2345907266,804259931,Spawn)
  97. StartConversation(conversation, NPC, Spawn, "Good work! I knew I could count on you. Take this small reward for your services.")
  98. end
  99. function QuestBegin1 (NPC, Spawn)
  100. FaceTarget(NPC, Spawn)
  101. OfferQuest(NPC, Spawn, Rats)
  102. end
  103. function QuestStart2 (NPC, Spawn)
  104. FaceTarget(NPC, Spawn)
  105. OfferQuest(NPC, Spawn, Bats)
  106. end
  107. function RewardRats(NPC, Spawn)
  108. SetStepComplete(Spawn, Rats, 2)
  109. end
  110. function BatsUpdate(NPC, Spawn)
  111. SetStepComplete(Spawn, Bats, 2)
  112. end
  113. function BatsFinish(NPC, Spawn)
  114. SetStepComplete(Spawn, Bats, 4)
  115. end