CarpenterPaddock.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --[[
  2. Script Name : SpawnScripts/QeynosHarbor/CarpenterPaddock.lua
  3. Script Purpose : Carpenter Paddock
  4. Script Author : Dorbin
  5. Script Date : 2022.05.10
  6. Script Notes :
  7. --]]
  8. local bow = 5529
  9. local beetles = 5532
  10. function spawn(NPC)
  11. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  12. AddTimer(NPC, 5000, "EmoteLoop")
  13. ProvidesQuest(NPC, beetles)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC,Spawn)
  19. if GetFactionAmount(Spawn, 11) <0 then
  20. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  21. else
  22. if not HasCompletedQuest (Spawn, beetles) then
  23. if math.random(1, 100) <= 80 then
  24. local choice = math.random(1,3)
  25. if choice == 1 then
  26. PlayFlavor(NPC, "voiceover/english/carpenter_paddock/qey_harbor/100_qst_carpenter_paddock_callout1_67878a5c.mp3", "We're running low on wood, but I don't want to mention it to Overseer Scarbourough until he calms down.", "", 2460409827, 3332556210, Spawn)
  27. elseif choice == 2 then
  28. FaceTarget(NPC,Spawn)
  29. PlayFlavor(NPC, "voiceover/english/carpenter_paddock/qey_harbor/100_qst_carpenter_paddock_multhail1_f2e09d24.mp3", "I'm very busy! Sorry, I've no time to talk!", "", 2269345214, 1588506015, Spawn)
  30. elseif choice == 3 then
  31. PlayFlavor(NPC, "voiceover/english/carpenter_paddock/qey_harbor/100_qst_carpenter_paddock_multhail2_e3288657.mp3", "I'm very busy! I must get more wood! ", "", 2812949705, 1915264340, Spawn)
  32. end
  33. else
  34. PlayFlavor(NPC, "", "", "hello", 0, 0, Spawn)
  35. FaceTarget(NPC,Spawn)
  36. end
  37. end
  38. end
  39. end
  40. function hailed(NPC, Spawn)
  41. FaceTarget(NPC, Spawn)
  42. if GetFactionAmount(Spawn, 11) <0 then
  43. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  44. else
  45. PlayFlavor(NPC, "voiceover/english/carpenter_paddock/qey_harbor/carpenterpaddock000.mp3", "", "frustrated", 118691548, 2274967025, Spawn)
  46. local conversation = CreateConversation()
  47. if not HasQuest(Spawn,beetles) and not HasCompletedQuest(Spawn, beetles) then
  48. AddConversationOption(conversation, "Do you need help getting more wood?", "Option1")
  49. end
  50. if GetQuestStep(Spawn,bow)==1 then
  51. AddConversationOption(conversation, "I'm here to pickup a bow Bryson ordered.", "Bryson")
  52. end
  53. if GetQuestStep(Spawn,beetles)==2 then
  54. AddConversationOption(conversation, "I've dealt with the fire beetles. Here are their carcases as proof.", "Beetledone")
  55. end
  56. AddConversationOption(conversation, "Good luck on replenishing your supply.")
  57. StartConversation(conversation, NPC, Spawn, "We're running out of wood, but I don't want to mention it to Overseer Scarborough until he calm's down.")
  58. end
  59. end
  60. function Bryson(NPC, Spawn)
  61. FaceTarget(NPC, Spawn)
  62. PlayFlavor(NPC, "voiceover/english/carpenter_paddock/qey_harbor/carpenterpaddock001.mp3", "", "agree", 367423194, 2653047684, Spawn)
  63. local conversation = CreateConversation()
  64. AddConversationOption(conversation, "I will. Thanks.", "FinishQuest1")
  65. StartConversation(conversation, NPC, Spawn, "Ah yes. I remember now. Bryson wanted me to carve him a super durable recurve bow. Give me a moment. Here it is! This fine bow shall serve him well. Make sure Bryson gets this in a timely manner.")
  66. end
  67. function FinishQuest1(NPC, Spawn)
  68. FaceTarget(NPC, Spawn)
  69. SetStepComplete(Spawn,bow, 1)
  70. end
  71. function Option1(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. PlayFlavor(NPC, "voiceover/english/carpenter_paddock/qey_harbor/carpenterpaddock002.mp3", "", "agree", 737863515, 3333157818, Spawn)
  74. local conversation = CreateConversation()
  75. AddConversationOption(conversation, "Gladly. I'll return with their carcases.", "StartQuest")
  76. AddConversationOption(conversation, "Bugs? Ew. No thanks.")
  77. StartConversation(conversation, NPC, Spawn, "Thank you for your offer, but we have plenty of help here! Though we could use help in Antonica where the fire beetles feast on our lumber. I'll pay you for the carcases of the vermin!")
  78. end
  79. function StartQuest(NPC, Spawn)
  80. FaceTarget(NPC, Spawn)
  81. OfferQuest(NPC, Spawn,beetles)
  82. end
  83. function Delivered(NPC, Spawn)
  84. FaceTarget(NPC, Spawn)
  85. PlayFlavor(NPC, "voiceover/english/carpenter_paddock/qey_harbor/carpenterpaddock003.mp3", "", "thanks", 988291901, 694482922, Spawn)
  86. local conversation = CreateConversation()
  87. AddConversationOption(conversation, "Glad I could help. Thanks.", "FinishQuest")
  88. StartConversation(conversation, NPC, Spawn, "Huh, you've done a fine job! This will keep our lumber in fine shape. Your services are invaluable! You certainly earned this reward.")
  89. end
  90. function FinishQuest(NPC, Spawn)
  91. FaceTarget(NPC, Spawn)
  92. SetStepComplete(Spawn,beetles, 2)
  93. end
  94. function EmoteLoop(NPC)
  95. local emoteChoice = MakeRandomInt(1,3)
  96. if emoteChoice == 1 then
  97. -- ponder
  98. PlayAnimation(NPC, 12030)
  99. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  100. elseif emoteChoice == 2 then
  101. -- sniff
  102. PlayAnimation(NPC, 12329)
  103. AddTimer(NPC, MakeRandomInt(6000,9000), "EmoteLoop")
  104. else
  105. -- tapfoot
  106. PlayAnimation(NPC, 13056)
  107. AddTimer(NPC, MakeRandomInt(15000,18000), "EmoteLoop")
  108. end
  109. end