9
3

Grekin.lua 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 : Grekin
  7. --]]
  8. local Req931 = 5489
  9. local Req378 = 5488
  10. local Deposit = 5490
  11. function spawn(NPC)
  12. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC, Deposit)
  14. end
  15. function InRange(NPC, Spawn) --Quest Callout
  16. if not HasCompletedQuest(Spawn, Deposit)then
  17. if math.random(1, 100) <= 70 then
  18. choice = math.random(1,2)
  19. FaceTarget(NPC, Spawn)
  20. if choice ==1 then
  21. 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)
  22. elseif choice ==2 then
  23. 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", 3289788151, 1391553241, Spawn)
  24. end
  25. end
  26. end
  27. end
  28. function hailed(NPC, Spawn)
  29. conversation = CreateConversation()
  30. FaceTarget(NPC, Spawn)
  31. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/merchantgrekin.mp3", "", "beckon", 2492969401, 3280493975, Spawn)
  32. if not HasQuest(Spawn, Deposit) then
  33. AddConversationOption(conversation, "Have any jobs I can do?", "DepositStart")
  34. end
  35. if GetQuestStep(Spawn, Deposit)==2 then
  36. AddConversationOption(conversation, "I have delivered your deposit.", "DepositDone")
  37. end
  38. if GetQuestStep(Spawn, Req931)==2 then
  39. AddConversationOption(conversation, "I have completed a requisition order for you.", "Req931Done")
  40. end
  41. if GetQuestStep(Spawn, Req378)==2 then
  42. AddConversationOption(conversation, "I have completed a requisition order for you.", "Req378Done")
  43. end
  44. AddConversationOption(conversation, "I'm just browsing. Thank you.")
  45. StartConversation(conversation, NPC, Spawn, "Come close. Come close! See what I have to offer today.")
  46. end
  47. function DepositStart(NPC, Spawn)
  48. conversation = CreateConversation()
  49. AddConversationOption(conversation, "You would trust me with your money?", "Trust")
  50. AddConversationOption(conversation, "On second thought, I'm busy.")
  51. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/merchantgrekin000.mp3","","agree",1743731083,2583786819,Spawn)
  52. StartConversation(conversation, NPC, Spawn, "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.")
  53. end
  54. function Trust(NPC, Spawn)
  55. conversation = CreateConversation()
  56. AddConversationOption(conversation, "Okay. I will be back.", "DepositBegin")
  57. AddConversationOption(conversation, "I don't want to get tangled up in this.")
  58. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/merchantgrekin001.mp3","","agree",2487079650,1001036096,Spawn)
  59. StartConversation(conversation, NPC, Spawn, "For starters, it is only a day's proceeds. Also, there are three guards between the banks and us. I'm pretty sure you would be caught if you tried to run. Aside from all that, you have a friendly face and I think I can trust you. Take this box to the bank and return with the recipt.")
  60. end
  61. function DepositBegin (NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. OfferQuest(NPC, Spawn, Deposit)
  64. end
  65. function DepositDone(NPC, Spawn)
  66. conversation = CreateConversation()
  67. AddConversationOption(conversation, "Glad I could help.", "DepositReward")
  68. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/merchantgrekin002.mp3","","thank",1911828027,460668749,Spawn)
  69. StartConversation(conversation, NPC, Spawn, "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.")
  70. end
  71. function DepositReward(NPC, Spawn)
  72. SetStepComplete(Spawn, Deposit, 2)
  73. end
  74. function Req931Done(NPC, Spawn)
  75. conversation = CreateConversation()
  76. AddConversationOption(conversation, "Thanks.", "Req931Reward")
  77. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/merchantgrekin003.mp3","","thank",57347681,3755735620,Spawn)
  78. StartConversation(conversation, NPC, Spawn, "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.")
  79. end
  80. function Req378Done(NPC, Spawn)
  81. conversation = CreateConversation()
  82. AddConversationOption(conversation, "Thanks.", "Req378Reward")
  83. PlayFlavor(NPC, "voiceover/english/merchant_grekin/qey_village02/merchantgrekin003.mp3","","thank",57347681,3755735620,Spawn)
  84. StartConversation(conversation, NPC, Spawn, "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.")
  85. end
  86. function Req931Reward(NPC, Spawn)
  87. SetStepComplete(Spawn, Req931, 2)
  88. end
  89. function Req378Reward(NPC, Spawn)
  90. SetStepComplete(Spawn, Req378, 3)
  91. end
  92. function DepositReward(NPC, Spawn)
  93. SetStepComplete(Spawn, Deposit, 2)
  94. end