Kruuprum.lua 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. require "SpawnScripts/Generic/DialogModule"
  9. local Bugs = 5461
  10. local Daggers = 5462
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC, Bugs)
  14. ProvidesQuest(NPC, Daggers)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function InRange(NPC, Spawn) --Quest Callout
  20. if math.random(1, 100) <= 66 then
  21. if not HasCompletedQuest (Spawn, Bugs) and not HasCompletedQuest (Spawn, Bugs) and GetLevel(Spawn) >=5 then
  22. choice = MakeRandomInt(1,3)
  23. FaceTarget(NPC, Spawn)
  24. if choice ==1 then
  25. 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.", "nod", 1179465815, 2252444306, Spawn)
  26. elseif choice ==2 then
  27. 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.", "hello", 3873091282, 3521185500, Spawn)
  28. else
  29. 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.", "sigh", 1535323046, 4151761005, Spawn)
  30. end
  31. elseif HasCompletedQuest (Spawn, Bugs) and HasCompletedQuest (Spawn, Daggers) then
  32. choice = MakeRandomInt(1,3)
  33. if choice ==1 then
  34. FaceTarget(NPC, Spawn)
  35. 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)
  36. elseif choice ==2 then
  37. FaceTarget(NPC, Spawn)
  38. PlayFlavor(NPC, "", "", "beckon", 0, 0, Spawn)
  39. else
  40. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  41. end
  42. end
  43. end
  44. end
  45. function hailed(NPC, Spawn)
  46. if GetFactionAmount(Spawn,11) <0 then
  47. FaceTarget(NPC, Spawn)
  48. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  49. else
  50. if GetLevel(Spawn) < 5 then
  51. FaceTarget(NPC, Spawn)
  52. 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)
  53. else
  54. FaceTarget(NPC, Spawn)
  55. Dialog.New(NPC, Spawn)
  56. Dialog.AddDialog("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!")
  57. Dialog.AddVoiceover("voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum.mp3",212021921, 86053123)
  58. PlayFlavor(NPC, "", "", "hello", 0,0 , Spawn)
  59. if not HasQuest(Spawn, Daggers) and not HasCompletedQuest(Spawn,Daggers) then
  60. Dialog.AddOption("Have any work for me?", "DaggerStart")
  61. end
  62. if not HasQuest(Spawn, Bugs) and not HasCompletedQuest(Spawn,Bugs) then
  63. Dialog.AddOption("Wow, you must be busy!", "BugStart")
  64. end
  65. if GetQuestStep(Spawn, Bugs)==2 then
  66. Dialog.AddOption("Here are some insects for you to munch on.", "DoneBugs")
  67. end
  68. if GetQuestStep(Spawn, Daggers)==2 then
  69. Dialog.AddOption("I've returned with your bag of daggers from Graystone.", "DoneDaggers")
  70. end
  71. Dialog.AddOption("I'm just browsing. Thank you.")
  72. Dialog.Start()
  73. end
  74. end
  75. end
  76. function DaggerStart(NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. Dialog.New(NPC, Spawn)
  79. Dialog.AddDialog("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.")
  80. Dialog.AddVoiceover("voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum003.mp3",3477024575,1591003971)
  81. PlayFlavor(NPC, "", "", "happy", 0,0 , Spawn)
  82. Dialog.AddOption("I will go get the daggers.", "QuestBegin2")
  83. Dialog.AddOption("Afraid I'm too busy right now.")
  84. Dialog.Start()
  85. end
  86. function DoneDaggers(NPC, Spawn)
  87. SetStepComplete(Spawn, Daggers, 2)
  88. FaceTarget(NPC, Spawn)
  89. Dialog.New(NPC, Spawn)
  90. Dialog.AddDialog("I thank thee. Here art a few coins for thy kind deed. And let me remindest thou that Kuuprum's emporium is the finest place to spend thy coin. No finer deal canst be found.")
  91. Dialog.AddVoiceover("voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum004.mp3",3621130333,3514541630)
  92. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  93. Dialog.AddOption("I will think about where to spend my coin.")
  94. Dialog.Start()
  95. end
  96. function BugStart(NPC, Spawn)
  97. FaceTarget(NPC, Spawn)
  98. Dialog.New(NPC, Spawn)
  99. Dialog.AddDialog("Aye, too busy ... I hath not had time to catch food in nearly three days. At this point, I'd even accept already dead insects. You wouldst not mind helping me out, would thou? I would be forever in thy debt! Or at least till mine belly is empty again. ")
  100. Dialog.AddVoiceover("voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum000.mp3",1882625212,2001028992)
  101. PlayFlavor(NPC, "", "", "sigh", 0,0 , Spawn)
  102. Dialog.AddOption("I suppose I could get some for you ", "QuestBegin1")
  103. Dialog.AddOption("Insects? I don't deal with creepy-crawlies. Sorry")
  104. Dialog.Start()
  105. end
  106. function DoneBugs(NPC, Spawn)
  107. SetStepComplete(Spawn, Bugs, 2)
  108. FaceTarget(NPC, Spawn)
  109. Dialog.New(NPC, Spawn)
  110. Dialog.AddDialog("I know what thou art thinking ... 'Tis certainly not a real meal, but it's better than starving! I just do not hath enough time to stepeth away from the tent and eat. As thou canst see, I hath got two tents worth of merchandise to watch. Take these coins in payment for thine timely intervention!")
  111. Dialog.AddVoiceover("voiceover/english/merchant_kruuprum/qey_village04/merchantkruuprum002.mp3",820028520,4244455128)
  112. PlayFlavor(NPC, "", "", "thanks", 0,0 , Spawn)
  113. Dialog.AddOption("I'm sure these will tide you over. Take care.")
  114. Dialog.AddOption( "Thanks. Enjoy your meal!")
  115. Dialog.Start()
  116. end
  117. function QuestBegin1 (NPC, Spawn)
  118. FaceTarget(NPC, Spawn)
  119. OfferQuest(NPC, Spawn, Bugs)
  120. end
  121. function QuestBegin2 (NPC, Spawn)
  122. FaceTarget(NPC, Spawn)
  123. OfferQuest(NPC, Spawn, Daggers)
  124. end