9
3

SeanWellfayer.lua 3.8 KB

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