Kruuprum.lua 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. --[[
  2. Script Name : SpawnScripts/Castleview/Kruuprum.lua
  3. Script Purpose : Kruuprum <General Goods>
  4. Script Author : Dorbin
  5. Script Date : 2022.01.28
  6. Script Notes :
  7. --]]
  8. local Bugs = 5461
  9. local Daggers = 5462
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Bugs)
  13. ProvidesQuest(NPC, Daggers)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn) --Quest Callout
  19. if math.random(1, 100) <= 60 then
  20. if not HasCompletedQuest (Spawn, Bugs) and not HasCompletedQuest (Spawn, Bugs) and GetLevel(Spawn) >=5 then
  21. choice = math.random(1,3)
  22. FaceTarget(NPC, Spawn)
  23. if choice ==1 then
  24. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/100_merchant_left_kuuprum_multhail3_f6fcb534.mp3", "Pray tell, wouldst thou be in possession of the flies? Ah ... I see ... then I shall wait to eat.", "", 1179465815, 2252444306, Spawn)
  25. elseif choice ==2 then
  26. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/100_merchant_left_kuuprum_multhail2_9a6056e9.mp3", "'Tis a great day when one browses mine wares. Mine stomach grumbles, yet I have so much to do.", "", 3873091282, 3521185500, Spawn)
  27. else
  28. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/100_merchant_left_kuuprum_multhail6_d113a4a3.mp3", "'Twere I to not be so busy, such as thyself, I could do more. Alas, I do not have the time to gander as one so gifted as thou.", "", 1535323046, 4151761005, Spawn)
  29. end
  30. elseif HasCompletedQuest (Spawn, Bugs) and HasCompletedQuest (Spawn, Daggers) then
  31. choice = math.random(1,3)
  32. if choice ==1 then
  33. FaceTarget(NPC, Spawn)
  34. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/100_merchant_left_kuuprum_callout _7959ca4b.mp3", "Verily, 'tis fine to havest thou here in Castleview! FroooOOOooaak! Fevalin and I here hath set up a nice arrangement and canst offer thou the widest variety of Qeynosian goods! Come view our wares!", "", 19553490, 2117485462, Spawn)
  35. elseif choice ==2 then
  36. FaceTarget(NPC, Spawn)
  37. PlayFlavor(NPC, "", "", "beckon", 0, 0, Spawn)
  38. else
  39. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  40. end
  41. end
  42. end
  43. end
  44. function hailed(NPC, Spawn)
  45. if GetLevel(Spawn) < 5 then
  46. FaceTarget(NPC, Spawn)
  47. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/100_merchant_left_kuuprum_multhail1_9d28d570.mp3", "Were I to possess the time to speak, 'twould be a gracious thing. I must continue selling mine items so I might catch a bite to eat. Mayhaps we can speak again.", "", 2901211010, 2505702223, Spawn)
  48. elseif HasCompletedQuest (Spawn, Bugs) and HasCompletedQuest (Spawn, Daggers) then
  49. local choice = math.random(1, 2)
  50. if choice == 1 then
  51. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/100_merchant_left_kuuprum_callout _7959ca4b.mp3", "Verily, 'tis fine to havest thou here in Castleview! FroooOOOooaak! Fevalin and I here hath set up a nice arrangement and canst offer thou the widest variety of Qeynosian goods! Come view our wares!", "", 19553490, 2117485462, Spawn)
  52. elseif choice == 2 then
  53. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/100_merchant_left_kuuprum_multhail1_9d28d570.mp3", "Were I to possess the time to speak, 'twould be a gracious thing. I must continue selling mine items so I might catch a bite to eat. Mayhaps we can speak again.", "", 2901211010, 2505702223, Spawn)
  54. end
  55. elseif not HasCompletedQuest (Spawn, Bugs) or not HasCompletedQuest (Spawn, Daggers) then
  56. FaceTarget(NPC, Spawn)
  57. conversation = CreateConversation()
  58. if not HasQuest(Spawn, Daggers) then
  59. AddConversationOption(conversation, "You seem busy. Have any errands I can do?", "DaggerStart")
  60. end
  61. if not HasQuest(Spawn, Bugs) then
  62. AddConversationOption(conversation, "I don't have any flies, but how can I help?", "BugStart")
  63. end
  64. if GetQuestStep(Spawn, Bugs)==2 then
  65. AddConversationOption(conversation, "Here are some bugs for you to munch on.", "DoneBugs")
  66. end
  67. if GetQuestStep(Spawn, Daggers)==2 then
  68. AddConversationOption(conversation, "I've returned with your bag of daggers.", "DoneDaggers")
  69. end
  70. AddConversationOption(conversation, "I'm just browsing. Thank you.")
  71. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum.mp3", "", "", 212021921, 86053123, Spawn)
  72. StartConversation(conversation, NPC, Spawn, "Verily, 'tis fine to havest thou here in Castleview! FroooOOOooaak! Fevalin and I here hath set up a nice arrangement and canst offer thou the widest variety of Qeynosian goods! Come view our wares!")
  73. end
  74. end
  75. function DaggerStart(NPC, Spawn)
  76. conversation = CreateConversation()
  77. AddConversationOption(conversation, "I'll head that way!", "QuestBegin2")
  78. AddConversationOption(conversation, "Afraid I'm busy.")
  79. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum003.mp3","","happy",3477024575,1591003971,Spawn)
  80. StartConversation(conversation, NPC, Spawn, "I can always use the aid of a refugee! Thou could do me a great service by venturing unto Snowboots Forge in Graystone Yard. Speak'th unto Ironmallet. He is holding a bag of sack of daggers for me. I have already paid for these items.")
  81. end
  82. function DoneDaggers(NPC, Spawn)
  83. conversation = CreateConversation()
  84. AddConversationOption(conversation, "I'm glad I could be of assistance.", "RewardDaggers")
  85. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum004.mp3","","thank",3621130333,3514541630,Spawn)
  86. StartConversation(conversation, NPC, Spawn, "I thank thee. Here art a few coins for thy kind deed. And let me remind'st thou that Kruuprum's Imporium is the finest place to spend thy coin. No greater deals can be found!")
  87. end
  88. function BugStart(NPC, Spawn)
  89. conversation = CreateConversation()
  90. AddConversationOption(conversation, "Don't worry. I'll find you something to eat.", "BugJob")
  91. AddConversationOption(conversation, "Insects? I don't deal with creepy-crawlies. Sorry")
  92. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum000.mp3","","sigh",1882625212,2001028992,Spawn)
  93. StartConversation(conversation, NPC, Spawn, "I'm too busy... I have not had the time to catch food in nearly three days! At this point I'd even accept already dead insects! You would not mind helping me out, would thou? I would be forever in thy debt! Well, at least until my belly is empty again...")
  94. end
  95. function BugJob(NPC, Spawn)
  96. conversation = CreateConversation()
  97. AddConversationOption(conversation, "I'll explore the Forest Ruins for some insects for you.", "QuestBegin1")
  98. AddConversationOption(conversation, "On second thought, I can't. Sorry.")
  99. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum001.mp3","","confused",3403348691,1398407939,Spawn)
  100. StartConversation(conversation, NPC, Spawn, "Praise Marr! Thou would'st be so kind! The meaty part of any insect would rightly do. That should tide me for at least a few days. I would happily pay thee some coin upon thy return.")
  101. end
  102. function DoneBugs(NPC, Spawn)
  103. conversation = CreateConversation()
  104. AddConversationOption(conversation, "I'm sure these will tide you over. Take care.", "RewardBugs")
  105. AddConversationOption(conversation, "Thanks. Enjoy your meal!", "RewardBugs")
  106. PlayFlavor(NPC, "voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum002.mp3","","shrug",820028520,4244455128,Spawn)
  107. StartConversation(conversation, NPC, Spawn, "I know what thou art thinking. This is certainly not a real meal, but it is better than starving. I just do not have enough time to step'th away from the tent and eat! As thou can see, I have two tents worth of merchandise to watch. Take these coins as payment for thy timely intervention!")
  108. end
  109. function QuestBegin1 (NPC, Spawn)
  110. FaceTarget(NPC, Spawn)
  111. OfferQuest(NPC, Spawn, Bugs)
  112. end
  113. function QuestBegin2 (NPC, Spawn)
  114. FaceTarget(NPC, Spawn)
  115. OfferQuest(NPC, Spawn, Daggers)
  116. end
  117. function RewardBugs(NPC, Spawn)
  118. SetStepComplete(Spawn, Bugs, 2)
  119. end
  120. function RewardDaggers(NPC, Spawn)
  121. SetStepComplete(Spawn, Daggers, 2)
  122. end