9
3

oakheart.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. --[[
  2. Script Name : oakheart.lua
  3. Script Purpose : Waypoint Path for oakheart.lua
  4. Script Author : Devn00b
  5. Script Date : 07/31/2020 07:37:47 PM
  6. Script Notes : Quest and dialogue added - 2022.05.10 - Dorbin
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. local report = 5531
  10. function spawn(NPC)
  11. waypoints(NPC)
  12. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC,report)
  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, report) and not HasQuest (Spawn, report) then
  23. if math.random(1, 100) <= 80 then
  24. PlayFlavor(NPC, "voiceover/english/pathfinder_oakheart/qey_elddar/100_pathed_woodelf_captain_callout1_fb0695da.mp3", "Excuse me! We rangers could use some assistance.", "wave", 3199480334, 2514081832, Spawn)
  25. FaceTarget(NPC, Spawn)
  26. end
  27. end
  28. end
  29. end
  30. function hailed(NPC, Spawn)
  31. FaceTarget(NPC, Spawn)
  32. if GetFactionAmount(Spawn, 11) <0 then
  33. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  34. else
  35. PlayFlavor(NPC, "voiceover/english/pathfinder_oakheart/qey_elddar/pathfinderoakheart.mp3", "", "hello", 2988013661, 1300543540, Spawn)
  36. local conversation = CreateConversation()
  37. if not HasQuest(Spawn,report) and not HasCompletedQuest(Spawn, report) then
  38. AddConversationOption(conversation, "Have anything I can help with?", "Option1")
  39. end
  40. if GetQuestStep(Spawn,report)==2 then
  41. AddConversationOption(conversation, "Master Gladwalker has your report and looks forward to the next one.", "Delivered")
  42. end
  43. AddConversationOption(conversation, "It is a sight to behold.")
  44. StartConversation(conversation, NPC, Spawn, "Can you see the Elddar? Its spirit can be felt in the beauty of the grove before you.")
  45. end
  46. end
  47. function Option1(NPC, Spawn)
  48. FaceTarget(NPC, Spawn)
  49. PlayFlavor(NPC, "voiceover/english/pathfinder_oakheart/qey_elddar/pathfinderoakheart000.mp3", "", "agree", 3865197718, 4107152769, Spawn)
  50. local conversation = CreateConversation()
  51. AddConversationOption(conversation, "Sure. I'll deliver your report", "StartQuest")
  52. AddConversationOption(conversation, "I'm not much for trees.")
  53. StartConversation(conversation, NPC, Spawn, "I knew you were a kindred soul to us Elddarians. Good friend of the forest! May I entrust you with an important errand? Our patrol's daily report must be delivered to Master Rysian Gladewalker of our guild hall at Arbos. Will you deliver it?")
  54. end
  55. function StartQuest(NPC, Spawn)
  56. FaceTarget(NPC, Spawn)
  57. OfferQuest(NPC, Spawn,report)
  58. end
  59. function Delivered(NPC, Spawn)
  60. FaceTarget(NPC, Spawn)
  61. PlayFlavor(NPC, "voiceover/english/pathfinder_oakheart/qey_elddar/pathfinderoakheart002.mp3", "", "thanks", 909119300, 2923998262, Spawn)
  62. local conversation = CreateConversation()
  63. AddConversationOption(conversation, "It was no problem. Good luck on patrol.", "FinishQuest")
  64. StartConversation(conversation, NPC, Spawn, "I thank you friend. You have saved us all, for we had no rangers to spare for this duty!")
  65. end
  66. function FinishQuest(NPC, Spawn)
  67. FaceTarget(NPC, Spawn)
  68. SetStepComplete(Spawn,report, 2)
  69. end
  70. function waypoints(NPC)
  71. MovementLoopAddLocation(NPC, 584.13, -18.24, -408.66, 2, math.random(0,8))
  72. MovementLoopAddLocation(NPC, 621.86, -15.32, -403.71, 2, math.random(0,8))
  73. MovementLoopAddLocation(NPC, 652.44, -11.39, -395.35, 2, math.random(0,8))
  74. MovementLoopAddLocation(NPC, 644.06, -13.16, -365.23, 2, math.random(0,8))
  75. MovementLoopAddLocation(NPC, 643.87, -18.16, -325.84, 2, math.random(0,8))
  76. MovementLoopAddLocation(NPC, 644.06, -13.16, -365.23, 2, math.random(0,8))
  77. MovementLoopAddLocation(NPC, 652.44, -11.39, -395.35, 2, math.random(0,8))
  78. MovementLoopAddLocation(NPC, 621.86, -15.32, -403.71, 2, math.random(0,8))
  79. MovementLoopAddLocation(NPC, 584.13, -18.24, -408.66, 2, math.random(0,8))
  80. end