SeanWellfayer.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. --[[
  2. Script Name : SpawnScripts/QeynosHarbor/SeanWellfayer.lua
  3. Script Purpose : Sean Wellfayer
  4. Script Author : Dorbin
  5. Script Date : 2022.05.31
  6. Script Notes :
  7. --]]
  8. function spawn(NPC)
  9. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function InRange(NPC, Spawn)
  15. end
  16. function LeaveRange(NPC, Spawn)
  17. end
  18. function hailed(NPC, Spawn)
  19. FaceTarget(NPC, Spawn)
  20. PlayFlavor(NPC, "voiceover/english/sean_wellfayer/qey_harbor/100_qst_sean_wellfayer_multhail2_e78a363.mp3", "If fishing doesn't interest you, perhaps bait does!", "", 3207653573, 2859825628, Spawn)
  21. end
  22. local bait = 5571
  23. require "SpawnScripts/Generic/DialogModule"
  24. function spawn(NPC)
  25. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  26. ProvidesQuest(NPC,bait)
  27. end
  28. function respawn(NPC)
  29. spawn(NPC)
  30. end
  31. function InRange(NPC, Spawn)
  32. if math.random(1,100) <70 then
  33. if GetFactionAmount(Spawn,11) <0 then
  34. if not HasQuest(Spawn,bait) and not HasCompletedQuest(Spawn,bait) then
  35. choice = math.random(1,3)
  36. if choice == 1 then
  37. PlayFlavor(NPC, "voiceover/english/sean_wellfayer/qey_harbor/100_qst_sean_wellfayer_multhail1_5dca659c.mp3", "I don't think fishing interests you. Perhaps you should be on your way!", "", 1997164956, 747011072, Spawn)
  38. elseif choice == 2 then
  39. PlayFlavor(NPC, "voiceover/english/sean_wellfayer/qey_harbor/100_qst_sean_wellfayer_multhail2_e78a363.mp3", "If fishing doesn't interest you, perhaps bait does!", "", 3207653573, 2859825628, Spawn)
  40. elseif choice == 3 then
  41. PlayFlavor(NPC, "voiceover/english/sean_wellfayer/qey_harbor/100_qst_sean_wellfayer_callout1_cf7b6fda.mp3", "Please, try your luck! I've been fishing here since I was a small boy, and I still have great luck hooking fish!", "", 3608210997, 2386511275, Spawn)
  42. end
  43. end
  44. end
  45. end
  46. end
  47. function LeaveRange(NPC, Spawn)
  48. end
  49. function hailed(NPC, Spawn)
  50. FaceTarget(NPC, Spawn)
  51. if GetFactionAmount(Spawn,11) <0 then
  52. choice = math.random(1,2)
  53. if choice == 1 then
  54. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  55. elseif choice == 2 then
  56. PlayFlavor(NPC, "", "", "glare", 1584866727, 581589457, Spawn)
  57. end
  58. else
  59. Dialog1(NPC,Spawn)
  60. end
  61. end
  62. function Dialog1(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. Dialog.New(NPC, Spawn)
  65. Dialog.AddDialog("Please try your luck! I've been fishing here since I was a small boy, and I still have great luck hooking fish!")
  66. Dialog.AddVoiceover("voiceover/english/sean_wellfayer/qey_harbor/seanwellfayer000.mp3", 2006211281, 54196600)
  67. if not HasQuest(Spawn,snakes) then
  68. Dialog.AddOption("How are the fish biting today?", "Dialog2")
  69. end
  70. if GetQuestStep(Spawn,snakes)==2 then
  71. Dialog.AddOption("I've brought the fairy wings and slug meat you were looking for.", "Dialog3")
  72. end
  73. Dialog.AddOption("Not interested right now. Good luck on your next catch.")
  74. Dialog.Start()
  75. end
  76. function Dialog2(NPC, Spawn)
  77. FaceTarget(NPC, Spawn)
  78. Dialog.New(NPC, Spawn)
  79. Dialog.AddDialog("I would be catching more fish if I had my special bait. I ran out not long ago and haven't had the time to gather more! You see all these others fishing here on the harbor? They are eyeing this spot, my spot! If you had some time, could you gather bait for me?")
  80. PlayFlavor(NPC,"","","sigh",0,0,Spawn)
  81. Dialog.AddOption("If you are willing to pay for it. I'd be happy to.","Job")
  82. Dialog.AddOption("Not interested. Good luck out here.")
  83. Dialog.Start()
  84. end
  85. function Job(NPC,Spawn)
  86. FaceTarget(NPC,Spawn)
  87. OfferQuest(NPC, Spawn,bait)
  88. end
  89. function Dialog3(NPC, Spawn)
  90. FaceTarget(NPC, Spawn)
  91. Dialog.New(NPC, Spawn)
  92. Dialog.AddVoiceover("voiceover/english/sean_wellfayer/qey_harbor/seanwellfayer002.mp3", 3480104575, 2347373334)
  93. Dialog.AddDialog("Good job, my friend! Now I've got pleanty of bait and I didn't even have to leave my lucky fishing spot. Please, let me pay you for your effots.")
  94. PlayFlavor(NPC,"","","thanks",0,0,Spawn)
  95. Dialog.AddOption("Glad to have helped.","JobDone")
  96. Dialog.Start()
  97. end
  98. function JobDone(NPC, Spawn)
  99. FaceTarget(NPC, Spawn)
  100. SetStepComplete(Spawn,bait, 2)
  101. end