9
3

JendanGreenthorn.lua 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --[[
  2. Script Name : SpawnScripts/WillowWood/JendanGreenthorn.lua
  3. Script Purpose : Jendan Greenthorn
  4. Script Author : Dorbin
  5. Script Date : 2022.02.18
  6. Script Notes :
  7. --]]
  8. local Message = 5479
  9. function spawn(NPC)
  10. ProvidesQuest(NPC,Message)
  11. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  12. end
  13. function InRange(NPC, Spawn)
  14. if not HasCompletedQuest (Spawn, Message) and not HasQuest (Spawn, Message) then
  15. if math.random(1, 100) <= 70 then
  16. FaceTarget(NPC,Spawn)
  17. local choice = math.random(1,3)
  18. if choice == 1 then
  19. PlayFlavor(NPC, "voiceover/english/jendan_greenthorn/qey_village05/100_jendan_greenthorn_callout_2edd959a.mp3", "Serian, where are you?! I must find my brother! Adventurer, have you seen Serian?", "sigh", 2641180045, 4231368071, Spawn)
  20. elseif choice == 2 then
  21. PlayFlavor(NPC, "voiceover/english/jendan_greenthorn/qey_village05/100_jendan_greenthorn_multhail1_f21756ea.mp3", "Sorry, friend. I can't chat. I'm waiting for my brother and would hate to miss him!", "no", 2945270851, 1633258355, Spawn)
  22. else
  23. PlayFlavor(NPC, "voiceover/english/jendan_greenthorn/qey_village05/100_jendan_greenthorn_multhail2_be6e96a1.mp3", "Hello, friend. Did you see my brother get off the boat? He looks just like me!", "hello", 4218404248, 1728712562, Spawn)
  24. end
  25. end
  26. elseif HasCompletedQuest (Spawn, Message) and math.random(1, 100) <= 60 then
  27. local choice = math.random(1,3)
  28. if choice == 1 then
  29. PlayFlavor(NPC, "","", "tap", 0, 0, Spawn)
  30. elseif choice == 2 then
  31. PlayFlavor(NPC, "","", "sigh", 0, 0, Spawn)
  32. else
  33. FaceTarget(NPC, Spawn)
  34. PlayFlavor(NPC, "","", "nod", 0, 0, Spawn)
  35. end
  36. end
  37. end
  38. function hailed(NPC, Spawn)
  39. FaceTarget(NPC, Spawn)
  40. PlayFlavor(NPC, "voiceover/english/jendan_greenthorn/qey_village05/jendangreenthorn000.mp3", "", "", 2553195028, 1519214978, Spawn)
  41. conversation = CreateConversation()
  42. if GetQuestStep(Spawn, Message) == 2 then
  43. AddConversationOption(conversation, "I talked with Innkeeper Yeoni. Sadly, she didn't have any messages to give you.", "MessageReturned")
  44. end
  45. if not HasQuest(Spawn, Message) and not HasCompletedQuest (Spawn, Message) then
  46. AddConversationOption(conversation, "I don't believe I have. Sorry.", "NoBrother")
  47. end
  48. if HasCompletedQuest (Spawn, Message) then
  49. AddConversationOption(conversation, "Not yet, Jendan. I'll let you know if I do.")
  50. end
  51. AddConversationOption(conversation, "What? I'm busy.")
  52. StartConversation(conversation, NPC, Spawn, "Hello, friend. You didn't happen to see my brother get off the boat just now, did you? He looks just like me!")
  53. end
  54. function NoBrother(NPC, Spawn)
  55. PlayFlavor(NPC, "voiceover/english/jendan_greenthorn/qey_village05/jendangreenthorn001.mp3","", "", 2420473664, 2318526010, Spawn)
  56. FaceTarget(NPC,Spawn)
  57. conversation = CreateConversation()
  58. AddConversationOption(conversation, "I'll take the note to Yeoni for you.", "TakeNote")
  59. AddConversationOption(conversation, "Sorry, I'm too busy.")
  60. StartConversation(conversation, NPC, Spawn, "I am hoping he comes this way. He left the Isle of Refuge one boat ahead of me and told me to meet him here. Would you run this note to Innkeeper Yeoni? Maybe Serian left a note with her earlier today.")
  61. end
  62. function TakeNote(NPC, Spawn)
  63. PlayFlavor(NPC, "voiceover/english/jendan_greenthorn/qey_village05/jendangreenthorn002.mp3","", "thank", 125091657, 2816219809, Spawn)
  64. FaceTarget(NPC,Spawn)
  65. conversation = CreateConversation()
  66. AddConversationOption(conversation, "I'll be back shortly.", "QuestOffer")
  67. StartConversation(conversation, NPC, Spawn, "Thank you! I'll stay here and watch the docks. Hopefully he'll come in on the next boat.")
  68. end
  69. function QuestOffer (NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. OfferQuest(NPC, Spawn, Message)
  72. end
  73. function MessageReturned(NPC, Spawn)
  74. PlayFlavor(NPC, "voiceover/english/jendan_greenthorn/qey_village05/jendangreenthorn003.mp3","", "thank", 3713247268, 3686475339, Spawn)
  75. FaceTarget(NPC,Spawn)
  76. conversation = CreateConversation()
  77. AddConversationOption(conversation, "Thanks, and good luck.", "QuestEnd")
  78. StartConversation(conversation, NPC, Spawn, "It's alright. He'll show up on the next boat... I know it. Thank you for the help! Here is a bit of money for your troubles.")
  79. end
  80. function QuestEnd(NPC, Spawn)
  81. SetStepComplete(Spawn, Message, 2)
  82. end