SeanWellfayer.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. local bait = 5571
  9. require "SpawnScripts/Generic/DialogModule"
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 8, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC,bait)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC, Spawn)
  18. if math.random(1,100) <70 then
  19. if GetFactionAmount(Spawn,11) <0 then
  20. if not HasQuest(Spawn,bait) and not HasCompletedQuest(Spawn,bait) then
  21. choice = math.random(1,3)
  22. if choice == 1 then
  23. 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)
  24. elseif choice == 2 then
  25. 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)
  26. elseif choice == 3 then
  27. 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)
  28. end
  29. end
  30. end
  31. end
  32. end
  33. function LeaveRange(NPC, Spawn)
  34. end
  35. function hailed(NPC, Spawn)
  36. FaceTarget(NPC, Spawn)
  37. if GetFactionAmount(Spawn,11) <0 then
  38. choice = math.random(1,2)
  39. if choice == 1 then
  40. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  41. elseif choice == 2 then
  42. PlayFlavor(NPC, "", "", "glare", 1584866727, 581589457, Spawn)
  43. end
  44. else
  45. Dialog1(NPC,Spawn)
  46. end
  47. end
  48. function Dialog1(NPC, Spawn)
  49. FaceTarget(NPC, Spawn)
  50. Dialog.New(NPC, Spawn)
  51. 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!")
  52. Dialog.AddVoiceover("voiceover/english/sean_wellfayer/qey_harbor/seanwellfayer000.mp3", 2006211281, 54196600)
  53. if not HasQuest(Spawn,bait) and not HasCompletedQuest(Spawn,bait) then
  54. Dialog.AddOption("How are the fish biting today?", "Dialog2")
  55. end
  56. if GetQuestStep(Spawn,bait)==2 then
  57. Dialog.AddOption("I've brought the fairy wings and slug meat you were looking for.", "Dialog3")
  58. end
  59. Dialog.AddOption("Not interested right now. Good luck on your next catch.")
  60. Dialog.Start()
  61. end
  62. function Dialog2(NPC, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. Dialog.New(NPC, Spawn)
  65. 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?")
  66. PlayFlavor(NPC,"","","sigh",0,0,Spawn)
  67. Dialog.AddOption("If you are willing to pay for it. I'd be happy to.","Job")
  68. Dialog.AddOption("Not interested. Good luck out here.")
  69. Dialog.Start()
  70. end
  71. function Job(NPC,Spawn)
  72. FaceTarget(NPC,Spawn)
  73. OfferQuest(NPC, Spawn,bait)
  74. end
  75. function Dialog3(NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. Dialog.New(NPC, Spawn)
  78. Dialog.AddVoiceover("voiceover/english/sean_wellfayer/qey_harbor/seanwellfayer002.mp3", 3480104575, 2347373334)
  79. 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.")
  80. PlayFlavor(NPC,"","","thanks",0,0,Spawn)
  81. Dialog.AddOption("Glad to have helped.","JobDone")
  82. Dialog.Start()
  83. end
  84. function JobDone(NPC, Spawn)
  85. FaceTarget(NPC, Spawn)
  86. SetStepComplete(Spawn,bait, 2)
  87. end