FarnsbyDunworth.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. SetInfoStructString(NPC, "action_state", "mood_afraid")
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function hailed(NPC, Spawn)
  19. SetTarget(NPC,Spawn)
  20. FaceTarget(NPC, Spawn)
  21. if GetFactionAmount(Spawn,11)<0 then
  22. PlayFlavor(NPC, "", "", "heckno", 0, 0, Spawn)
  23. else
  24. HailCheck = true
  25. Dialog1(NPC, Spawn)
  26. AddTimer(NPC,32000,"HailReset")
  27. end
  28. end
  29. function HailReset(NPC)
  30. HailCheck = false
  31. end
  32. function Dialog1(NPC, Spawn)
  33. FaceTarget(NPC, Spawn)
  34. Dialog.New(NPC, Spawn)
  35. PlayFlavor(NPC, "", "", "whome", 0, 0, Spawn)
  36. Dialog.AddDialog("Hey, I don't know what they are talking about. I've never seen such a scroll in my life!")
  37. Dialog.AddVoiceover("voiceover/english/farnsby_dunworth/qey_village02/farnsbydunworth000.mp3", 3102016344, 1493102371)
  38. if not HasQuest(Spawn,243) and not HasCompletedQuest(Spawn,243)then
  39. Dialog.AddOption("You seem to be in a predicament. Need any help?","Dialog2")
  40. end
  41. if HasCompletedQuest(Spawn,243)then
  42. Dialog.AddOption("Still at it Farmsbey? Might want to give them what they want.")
  43. end
  44. if GetQuestStep(Spawn,243)==2 then
  45. Dialog.AddOption("I've returned with your axe from the blacksmith.","Delivered")
  46. end
  47. Dialog.AddOption("Good luck with your 'situation'.")
  48. Dialog.Start()
  49. end
  50. function Dialog2(NPC, Spawn)
  51. FaceTarget(NPC, Spawn)
  52. Dialog.New(NPC, Spawn)
  53. PlayFlavor(NPC, "", "", "no", 0, 0, Spawn)
  54. 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?")
  55. Dialog.AddVoiceover("voiceover/english/farnsby_dunworth/qey_village02/farnsbydunworth001.mp3", 1750948791, 3710883343)
  56. Dialog.AddOption("You do seem to have your hands full. I'll go talk with the blacksmith for you.", "QuestBegin")
  57. Dialog.AddOption("You obviously have MANY 'situations' going on. Too many for me to keep track.")
  58. Dialog.Start()
  59. end
  60. function QuestBegin (NPC, Spawn)
  61. FaceTarget(NPC, Spawn)
  62. OfferQuest(NPC, Spawn, 243)
  63. end
  64. function Delivered(NPC, Spawn)
  65. FaceTarget(NPC, Spawn)
  66. Dialog.New(NPC, Spawn)
  67. SetStepComplete(Spawn, 243, 2)
  68. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  69. 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 you could use it!")
  70. Dialog.AddVoiceover("voiceover/english/farnsby_dunworth/qey_village02/farnsbydunworth003.mp3", 2174088853, 1124987532)
  71. Dialog.AddOption("I think I could use it too. Good luck with these two erudites!")
  72. Dialog.Start()
  73. end
  74. function EmoteLoop(NPC)
  75. if HailCheck == true then
  76. AddTimer(NPC,26100,"EmoteLoop")
  77. else
  78. local emoteChoice = MakeRandomInt(1,6)
  79. if emoteChoice == 1 then
  80. -- whome
  81. PlayAnimation(NPC, 13295)
  82. AddTimer(NPC, MakeRandomInt(11000,12000), "EmoteLoop")
  83. elseif emoteChoice == 2 then
  84. -- shrug
  85. PlayAnimation(NPC, 12240)
  86. AddTimer(NPC, MakeRandomInt(6000,8000), "EmoteLoop")
  87. elseif emoteChoice == 3 then
  88. -- heckno
  89. PlayAnimation(NPC, 11680)
  90. AddTimer(NPC, MakeRandomInt(12000,14000), "EmoteLoop")
  91. elseif emoteChoice == 4 then
  92. -- cringe
  93. PlayAnimation(NPC, 11256)
  94. AddTimer(NPC, MakeRandomInt(8000,9000), "EmoteLoop")
  95. elseif emoteChoice == 5 then
  96. -- beg
  97. PlayAnimation(NPC, 10844)
  98. AddTimer(NPC, MakeRandomInt(12000,13500), "EmoteLoop")
  99. elseif emoteChoice == 6 then
  100. -- no
  101. PlayAnimation(NPC, 11881)
  102. AddTimer(NPC, MakeRandomInt(5000,6000), "EmoteLoop")
  103. end
  104. end
  105. end