HarronGriswald.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. --[[
  2. Script Name : SpawnScripts/QeynosHarbor/HarronGriswald.lua
  3. Script Purpose : Harron Griswald <General Goods>
  4. Script Author : Dorbin
  5. Script Date : 2022.05.23
  6. Script Notes :
  7. --]]
  8. local Delivery = 5562
  9. function spawn(NPC)
  10. AddTimer(NPC, 5000, "EmoteLoop")
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. ProvidesQuest(NPC, Delivery)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function InRange(NPC, Spawn)
  18. if GetFactionAmount(Spawn,11) <0 then
  19. FaceTarget(NPC, Spawn)
  20. choice = math.random(1,2)
  21. if choice == 1 then
  22. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  23. elseif choice == 2 then
  24. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  25. end
  26. end
  27. function LeaveRange(NPC, Spawn)
  28. end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. if GetFactionAmount(Spawn,11) <0 then
  32. choice = math.random(1,2)
  33. if choice == 1 then
  34. PlayFlavor(NPC, "", "", "shakefist", 2088886924, 3736631596, Spawn)
  35. elseif choice == 2 then
  36. PlayFlavor(NPC, "", "", "heckno", 1584866727, 581589457, Spawn)
  37. end
  38. else
  39. voice = math.random (1,3)
  40. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_"..voice.."_1052.mp3", "", "hello", 0, 0, Spawn)
  41. local conversation = CreateConversation()
  42. if not HasQuest(Spawn,Delivery) and not HasCompletedQuest(Spawn, Delivery) then
  43. AddConversationOption(conversation, "That was nice of him to give you a job. Do you need any help with your tasks?", "Delivery1")
  44. end
  45. if GetQuestStep(Spawn,Delivery)==2 then
  46. AddConversationOption(conversation, "I have brought back your rope for you.", "Delivered")
  47. end
  48. AddConversationOption(conversation, "Sounds like they are just having a good time when they get back from a long voyage.")
  49. StartConversation(conversation, NPC, Spawn, "If you're looking for the bar, it's upstairs. Be careful of the Coldwind Marauders -- they really enjoy their drink. I'm too busy to join you just now. Erwin was kind enough to order rope from me. I don't want to disappoint him, but it's a big job, and I don't know if I can do it alone.")
  50. end
  51. end
  52. end
  53. function Delivery1(NPC,Spawn)
  54. FaceTarget(NPC, Spawn)
  55. PlayFlavor(NPC, "", "", "nod", 0, 0, Spawn)
  56. local conversation = CreateConversation()
  57. AddConversationOption(conversation, "That doesn't sound like it would be too hard at all.", "Delivery2")
  58. AddConversationOption(conversation, "Oh wait, I have this thing I have to get to. Sorry.")
  59. StartConversation(conversation, NPC, Spawn, "I weave nets and braid harpoon lines for the fishermen here. I have an order of rope waiting for me at Elddar Grove, but I'm behind with my work and I haven't been able to pick it up. Would you help an old man out and get my rope from merchant Adrianna?")
  60. end
  61. function Delivery2(NPC, Spawn)
  62. PlayFlavor(NPC, "", "", "thanks", 0, 0, Spawn)
  63. FaceTarget(NPC, Spawn)
  64. OfferQuest(NPC, Spawn,Delivery)
  65. end
  66. function Delivered(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. PlayFlavor(NPC, "", "", "smile", 0, 0, Spawn)
  69. local conversation = CreateConversation()
  70. AddConversationOption(conversation, "That works for me!", "FinishQuest")
  71. StartConversation(conversation, NPC, Spawn, "This is just what I needed. You've helped greatly. Here's some coin, and thanks again.")
  72. end
  73. function FinishQuest(NPC, Spawn)
  74. FaceTarget(NPC, Spawn)
  75. SetStepComplete(Spawn,Delivery, 2)
  76. end
  77. function EmoteLoop(NPC)
  78. local emoteChoice = MakeRandomInt(1,3)
  79. if emoteChoice == 1 then
  80. -- ponder
  81. PlayAnimation(NPC, 12030)
  82. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  83. elseif emoteChoice == 2 then
  84. -- sniff
  85. PlayAnimation(NPC, 12329)
  86. AddTimer(NPC, MakeRandomInt(6000,9000), "EmoteLoop")
  87. else
  88. -- tapfoot
  89. PlayAnimation(NPC, 13056)
  90. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  91. end
  92. end