9
3

FarnsbyDunworth.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. --[[
  2. Script Name : SpawnScripts/Starcrest/FarnsbyDunworth.lua
  3. Script Purpose : Farnsby Dunworth
  4. Script Author : Dorbin
  5. Script Date : 03.07.2022
  6. Script Notes :
  7. --]]
  8. require "SpawnScripts/Generic/DialogModule"
  9. local HailCheck = false
  10. function spawn(NPC)
  11. AddTimer(NPC, 5000, "EmoteLoop")
  12. ProvidesQuest(NPC,243)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function hailed(NPC, Spawn)
  18. SetTarget(NPC,Spawn)
  19. FaceTarget(NPC, Spawn)
  20. if GetFactionAmount(Spawn,11)<0 then
  21. PlayFlavor(NPC, "", "", "heckno", 0, 0, Spawn)
  22. else
  23. HailCheck = true
  24. Dialog1(NPC, Spawn)
  25. AddTimer(NPC,32000,"HailReset")
  26. end
  27. end
  28. function HailReset(NPC)
  29. HailCheck = false
  30. end
  31. function Dialog1(NPC, Spawn)
  32. FaceTarget(NPC, Spawn)
  33. Dialog.New(NPC, Spawn)
  34. PlayFlavor(NPC, "", "", "whome", 0, 0, Spawn)
  35. Dialog.AddDialog("Hey, I don't know what they are talking about. I've never seen such a scroll in my life!")
  36. Dialog.AddVoiceover("voiceover/english/farnsby_dunworth/qey_village02/farnsbydunworth000.mp3", 3102016344, 1493102371)
  37. if not HasQuest(Spawn,243) and not HasCompletedQuest(Spawn,243)then
  38. Dialog.AddOption("You seem to be in a predicament. Need any help?","Dialog2")
  39. end
  40. if HasCompletedQuest(Spawn,243)then
  41. Dialog.AddOption("Still at it Farmsbey? Might want to give them what they want.")
  42. end
  43. if GetQuestStep(Spawn,243)==2 then
  44. Dialog.AddOption("I've returned with your axe from the blacksmith.","Delivered")
  45. end
  46. Dialog.AddOption("Good luck with your 'situation'.")
  47. Dialog.Start()
  48. end
  49. function Dialog2(NPC, Spawn)
  50. FaceTarget(NPC, Spawn)
  51. Dialog.New(NPC, Spawn)
  52. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  53. Dialog.AddDialog("I think I'm alright for now, but their questions are holding me up from fetching the axe I ordered from the blacksmith! Do you think you could lend a hand with that?")
  54. Dialog.AddVoiceover("voiceover/english/farnsby_dunworth/qey_village02/farnsbydunworth001.mp3", 1750948791, 3710883343)
  55. Dialog.AddOption("You do seem to have your hands full. I'll go talk with the blacksmith for you.", "QuestBegin")
  56. Dialog.AddOption("You obviously have MANY 'situations' going on. Too many for me to keep track.")
  57. Dialog.Start()
  58. end
  59. function QuestBegin (NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. OfferQuest(NPC, Spawn, 243)
  62. end
  63. function Delivered(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. Dialog.New(NPC, Spawn)
  66. SetStepComplete(Spawn, 243, 2)
  67. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  68. Dialog.AddDialog("Glad to hear it! Ah, this is a fine axe indeed! I'll have to compliment Barrik on his work the next time we meet. Here's a bit of my leftover coin. I think I could use it!")
  69. Dialog.AddVoiceover("voiceover/english/farnsby_dunworth/qey_village02/farnsbydunworth003.mp3", 2174088853, 1124987532)
  70. Dialog.AddOption("I think I could use it too. Good luck with these two erudites!")
  71. Dialog.Start()
  72. end
  73. function EmoteLoop(NPC)
  74. if HailCheck == true then
  75. AddTimer(NPC,26100,"EmoteLoop")
  76. else
  77. local emoteChoice = MakeRandomInt(1,6)
  78. if emoteChoice == 1 then
  79. -- whome
  80. PlayAnimation(NPC, 13295)
  81. AddTimer(NPC, MakeRandomInt(11000,12000), "EmoteLoop")
  82. elseif emoteChoice == 2 then
  83. -- shrug
  84. PlayAnimation(NPC, 12240)
  85. AddTimer(NPC, MakeRandomInt(6000,8000), "EmoteLoop")
  86. elseif emoteChoice == 3 then
  87. -- heckno
  88. PlayAnimation(NPC, 11680)
  89. AddTimer(NPC, MakeRandomInt(12000,14000), "EmoteLoop")
  90. elseif emoteChoice == 4 then
  91. -- cringe
  92. PlayAnimation(NPC, 11256)
  93. AddTimer(NPC, MakeRandomInt(8000,9000), "EmoteLoop")
  94. elseif emoteChoice == 5 then
  95. -- beg
  96. PlayAnimation(NPC, 10844)
  97. AddTimer(NPC, MakeRandomInt(12000,13500), "EmoteLoop")
  98. elseif emoteChoice == 6 then
  99. -- no
  100. PlayAnimation(NPC, 11881)
  101. AddTimer(NPC, MakeRandomInt(5000,6000), "EmoteLoop")
  102. end
  103. end
  104. end