Grekin.lua 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/Grekin.lua
  3. Script Purpose : Grekin <Bowyer>
  4. Script Author : Dorbin
  5. Script Date : 2022.02.24
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local Req931 = 5489
  10. local Req378 = 5488
  11. local Deposit = 5490
  12. function spawn(NPC)
  13. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  14. ProvidesQuest(NPC, Deposit)
  15. end
  16. function InRange(NPC, Spawn) --Quest Callout
  17. if GetFactionAmount(Spawn,11)<0 then
  18. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  19. else
  20. if not HasCompletedQuest(Spawn, Deposit)then
  21. if math.random(1, 100) <= 80 then
  22. choice = math.random(1,3)
  23. FaceTarget(NPC, Spawn)
  24. if choice ==1 then
  25. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/100_human_merchant_m_01_multhail1_78077dd5.mp3", "Sorry friend. I don't think you can help me.", "no", 3289788151, 1391553241, Spawn)
  26. elseif choice ==2 then
  27. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/100_human_merchant_m_01_callout_9b7d7d4.mp3", "To close the store or deliever the deposit. That is the question. If only I didn't have to choose! Perhaps you can help me traveler?", "ponder", 1399992844, 4031649272, Spawn)
  28. elseif choice ==3 then
  29. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/100_human_merchant_m_01_callout_9b7d7d4.mp3", "To close the store or deliever the deposit. That is the question. If only I didn't have to choose! Perhaps you can help me traveler?", "ponder", 1399992844, 4031649272, Spawn)
  30. end
  31. end
  32. end
  33. end
  34. end
  35. function hailed(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. if GetFactionAmount(Spawn,11)<0 then
  38. PlayFlavor(NPC, "", "", "heckno", 0, 0, Spawn)
  39. else
  40. Dialog1(NPC, Spawn)
  41. end
  42. end
  43. function Dialog1(NPC, Spawn)
  44. FaceTarget(NPC, Spawn)
  45. Dialog.New(NPC, Spawn)
  46. PlayFlavor(NPC, "", "", "beckon", 0, 0, Spawn)
  47. Dialog.AddDialog("Come close. Come close! See what I have to offer today.")
  48. Dialog.AddVoiceover("voiceover/english/merchant_grekin/qey_village02/merchantgrekin.mp3", 2492969401, 3280493975)
  49. if not HasQuest(Spawn, Deposit) and not HasCompletedQuest(Spawn, Deposit) then
  50. Dialog.AddOption("You seem to be rather busy. I'm looking for work if you need help.","DepositStart")
  51. end
  52. if GetQuestStep(Spawn, Deposit)==2 then
  53. Dialog.AddOption("I have delivered your deposit to the Qeynos Exchange.","DepositDone")
  54. end
  55. if GetQuestStep(Spawn, Req931)==3 or GetQuestStep(Spawn, Req378)==2 then
  56. Dialog.AddOption("I have completed a requisition order for you.","ReqDone")
  57. end
  58. Dialog.AddOption("I'm just browsing. Thank you.")
  59. Dialog.Start()
  60. end
  61. function DepositStart(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. Dialog.New(NPC, Spawn)
  64. Dialog.AddDialog("If it's coin you need I can help out, but you'll have to do a favor for me. I need my daily proceeds delivered to the bank.")
  65. Dialog.AddVoiceover("voiceover/english/merchant_grekin/qey_village02/merchantgrekin000.mp3", 1743731083,2583786819)
  66. Dialog.AddOption("You would trust me with your money?", "DepositBegin")
  67. Dialog.AddOption("On second thought, I shouldn't be handling someone else's large sums of coin.")
  68. Dialog.Start()
  69. end
  70. function DepositBegin (NPC, Spawn)
  71. FaceTarget(NPC, Spawn)
  72. OfferQuest(NPC, Spawn, Deposit)
  73. end
  74. function DepositDone(NPC, Spawn)
  75. FaceTarget(NPC, Spawn)
  76. Dialog.New(NPC, Spawn)
  77. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  78. SetStepComplete(Spawn, Deposit, 2)
  79. Dialog.AddDialog("Excellent! I'm so busy here I don't have time for simple chores. I would have to close up shop, and I don't have time for that.")
  80. Dialog.AddVoiceover("voiceover/english/merchant_grekin/qey_village02/merchantgrekin002.mp3", 1911828027, 460668749)
  81. Dialog.AddOption("Glad I could help.")
  82. Dialog.Start()
  83. end
  84. function ReqDone(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. Dialog.New(NPC, Spawn)
  87. PlayFlavor(NPC, "", "", "boggle", 0, 0, Spawn)
  88. if GetQuestStep(Spawn, Req931)==3 then
  89. SetStepComplete(Spawn, Req931, 3)
  90. end
  91. if GetQuestStep(Spawn, Req378)== 2 then
  92. SetStepComplete(Spawn, Req378, 2)
  93. end
  94. Dialog.AddDialog("My requisition! I've waited for this for far too long. You would think a local requisition could be fulfilled much quicker. Take your fee and be off.")
  95. Dialog.AddVoiceover("voiceover/english/merchant_grekin/qey_village02/merchantgrekin003.mp3", 57347681,3755735620)
  96. Dialog.AddOption("Thanks.")
  97. Dialog.Start()
  98. end