9
3

CarpenterPaddock.lua 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. ProvidesQuest(NPC, beetles)
  13. waypoints(NPC)
  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 Beetledone(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 Emotes(NPC)
  95. local emoteChoice = MakeRandomInt(1,3)
  96. if emoteChoice == 1 then
  97. -- ponder
  98. PlayAnimation(NPC, 12030)
  99. elseif emoteChoice == 2 then
  100. -- sniff
  101. PlayAnimation(NPC, 12329)
  102. else
  103. -- tapfoot
  104. PlayAnimation(NPC, 13056)
  105. end
  106. end
  107. function waypoints(NPC)
  108. MovementLoopAddLocation(NPC, 937.68, -25.27, 98.76, 2, 0)
  109. MovementLoopAddLocation(NPC, 937.68, -25.27, 98.76, 2, 14,"Emotes")
  110. MovementLoopAddLocation(NPC, 940.06, -25.27, 103.64, 2, 1)
  111. MovementLoopAddLocation(NPC, 940.06, -25.27, 103.64, 2, 14,"Emotes")
  112. MovementLoopAddLocation(NPC, 947.46, -25.27, 103.79, 2, 1)
  113. MovementLoopAddLocation(NPC, 947.46, -25.27, 103.79, 2, 14,"Emotes")
  114. MovementLoopAddLocation(NPC, 953.35, -25.27, 102.16, 2, 0)
  115. MovementLoopAddLocation(NPC, 961.61, -25.27, 106.84, 2, 1)
  116. MovementLoopAddLocation(NPC, 961.61, -25.27, 106.84, 2, 14,"Emotes")
  117. MovementLoopAddLocation(NPC, 957.28, -25.27, 107.64, 2, 1)
  118. MovementLoopAddLocation(NPC, 957.28, -25.27, 107.64, 2, 14,"Emotes")
  119. MovementLoopAddLocation(NPC, 958.11, -25.27, 103.57, 2, 0)
  120. MovementLoopAddLocation(NPC, 947.08, -25.27, 99.1, 2, 1)
  121. MovementLoopAddLocation(NPC, 947.08, -25.27, 99.1, 2, 14,"Emotes")
  122. MovementLoopAddLocation(NPC, 940.16, -25.27, 97.93, 2, 0)
  123. MovementLoopAddLocation(NPC, 933.77, -25.27, 106.09, 2, 1)
  124. MovementLoopAddLocation(NPC, 933.77, -25.27, 106.09, 2, 14,"Emotes")
  125. end