9
3

Leon.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/Leon.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.07.20 06:07:01
  5. Script Purpose :
  6. :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local CalloutTimer = false
  10. function spawn(NPC)
  11. ProvidesQuest(NPC,5760)
  12. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  13. end
  14. function InRange(NPC, Spawn) --Quest Callout
  15. if GetFactionAmount(Spawn,11)<0 then
  16. PlayFlavor(NPC, "", "", "glare", 0, 0, Spawn)
  17. FaceTarget(NPC, Spawn)
  18. elseif GetRace(Spawn)== 7 or GetRace(Spawn)== 5 then
  19. if not HasQuest(Spawn,5760) and not HasCompletedQuest(Spawn, 5760)then
  20. Talk(NPC,Spawn)
  21. elseif CalloutTimer == false then
  22. CalloutTimer = true
  23. AddTimer(NPC,90000,"ResetCallout",1,Spawn)
  24. Talk(NPC,Spawn)
  25. end
  26. elseif CalloutTimer == false then
  27. CalloutTimer = true
  28. AddTimer(NPC,90000,"ResetCallout",1,Spawn)
  29. Talk(NPC,Spawn)
  30. end
  31. end
  32. function ResetCallout(NPC,Spawn)
  33. CalloutTimer = false
  34. end
  35. function hailed(NPC, Spawn)
  36. if GetFactionAmount(Spawn,11)<0 then
  37. PlayFlavor(NPC,"","","shakefist",0,0,Spawn)
  38. else
  39. if GetRace(Spawn)== 7 or GetRace(Spawn)== 5 then
  40. if not HasQuest(Spawn,5760) and not HasCompletedQuest(Spawn, 5760)then
  41. FaceTarget(NPC, Spawn)
  42. Dialog.New(NPC, Spawn)
  43. Dialog.AddDialog("Greetings, friend! I was just saying to myself, \"Leon, I bet that person is a refugee and needs your help.\" I was right, wasn't I? Well, if you need help then you came to the right place. Welcome to Qeynos!")
  44. Dialog.AddVoiceover("voiceover/english/steward_leon/qey_village06/steward_leon001.mp3", 2019816460, 2210116223)
  45. PlayFlavor(NPC,"","","hello",0,0,Spawn)
  46. Dialog.AddOption("It feel good to have land under my feet again!","Dialog1")
  47. Dialog.AddOption("I'll have to continue this conversation a bit later.")
  48. Dialog.Start()
  49. else
  50. Talk(NPC,Spawn)
  51. end
  52. else
  53. Talk(NPC,Spawn)
  54. end
  55. end
  56. end
  57. function Talk(NPC,Spawn)
  58. FaceTarget(NPC, Spawn)
  59. local choice = MakeRandomInt(1,2)
  60. if choice == 1 then
  61. PlayFlavor(NPC,"voiceover/english/steward_leon/qey_village06/qst_steward_leon_callout1_454cfdb9.mp3","This day would be perfect if, only I had a cool mug of jum-jum. Oh well.","agree",251868759,1191048205,Spawn)
  62. elseif choice == 2 then
  63. PlayFlavor(NPC,"voiceover/english/steward_leon/qey_village06/qst_steward_leon_hail1_374c1914.mp3","This would be a perfect day if I had a cool mug of jum-jum. Mmmmm ... Mmmm ... I must get some jum-jum! Sorry, friend. I can't talk now!","smile",3110431219,3470484865,Spawn)
  64. end
  65. end
  66. function respawn(NPC)
  67. spawn(NPC)
  68. end
  69. function Dialog1(NPC, Spawn)
  70. FaceTarget(NPC, Spawn)
  71. Dialog.New(NPC, Spawn)
  72. Dialog.AddDialog("You must be hungry after all that sailing! I'm not big on boats, but I enjoy a day of fishing in the stream. Maybe once you settle in your new home, we can go fishing!")
  73. PlayFlavor(NPC,"","","happy",0,0,Spawn)
  74. Dialog.AddVoiceover("voiceover/english/steward_leon/qey_village06/steward_leon002.mp3", 3870008378, 3262627233)
  75. Dialog.AddOption("Wait, I get my own home here?", "Dialog2")
  76. Dialog.Start()
  77. end
  78. function Dialog2(NPC, Spawn)
  79. FaceTarget(NPC, Spawn)
  80. Dialog.New(NPC, Spawn)
  81. Dialog.AddDialog("We would never leave you without a place to sleep! You have a home as long as you are in Baubbleshire. That Queen sure has a big heart, doesn't she? I'm not one for royalty, but I can't imagine anyone else as our queen!")
  82. Dialog.AddVoiceover("voiceover/english/steward_leon/qey_village06/steward_leon003.mp3", 2443307894, 340001901)
  83. PlayFlavor(NPC,"","","no",0,0,Spawn)
  84. Dialog.AddOption("Wow, The Baubbleshire?", "QuestStart")
  85. Dialog.Start()
  86. end
  87. function QuestStart(NPC,Spawn)
  88. FaceTarget(NPC, Spawn)
  89. OfferQuest(NPC,Spawn,5760)
  90. end