fanthis.lua 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. --[[
  2. Script Name : fanthis.lua
  3. Script Purpose : Waypoint Path for fanthis.lua
  4. Script Author : Devn00b
  5. Script Date : 07/31/2020 07:33:49 PM
  6. Script Notes : Locations collected from Live
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. local arrows = 5521
  10. function spawn(NPC)
  11. waypoints(NPC)
  12. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  13. ProvidesQuest(NPC,arrows)
  14. end
  15. function hailed(NPC, Spawn)
  16. FaceTarget(NPC, Spawn)
  17. if GetFactionAmount(Spawn, 11) <0 then
  18. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  19. else
  20. PlayFlavor(NPC, "voiceover/english/patrolman_fanthis/qey_elddar/patrolmanfanthis.mp3", "", "hello", 1693710437, 2806489580, Spawn)
  21. local conversation = CreateConversation()
  22. if not HasQuest(Spawn,arrows) and not HasCompletedQuest(Spawn, arrows) then
  23. AddConversationOption(conversation, "Do you need assistance while on duty?", "Option1")
  24. end
  25. if GetQuestStep(Spawn,arrows)==2 then
  26. AddConversationOption(conversation, "Here are the arrows. Nightbow said not to keep her waiting so long next time.", "Delivered")
  27. end
  28. AddConversationOption(conversation, "Good day, then.")
  29. StartConversation(conversation, NPC, Spawn, "Greetings! I am Patrolman Fanthis. Sadly, I have no time to speak while on duty.")
  30. end
  31. end
  32. function InRange(NPC,Spawn)
  33. if GetFactionAmount(Spawn, 11) <0 then
  34. PlayFlavor(NPC, "", "", "shakefist", 0, 0, Spawn)
  35. else
  36. if not HasCompletedQuest (Spawn, arrows) and not HasQuest (Spawn, arrows) then
  37. if math.random(1, 100) <= 80 then
  38. PlayFlavor(NPC, "voiceover/english/patrolman_fanthis/qey_elddar/100_patrolman_halfelf_fanthis_callout1_9ff23be1.mp3", "Greetings! I am Patrolman Fanthis. I wish I had time to chat, but duty calls.", "attention", 2986438322, 1619790403, Spawn)
  39. end
  40. end
  41. end
  42. end
  43. function respawn(NPC)
  44. spawn(NPC)
  45. end
  46. function waypoints(NPC)
  47. MovementLoopAddLocation(NPC, 648.13, -13.26, -358.4, 2, math.random(0,8))
  48. MovementLoopAddLocation(NPC, 646.13, -19.97, -319.17, 2, math.random(0,8))
  49. MovementLoopAddLocation(NPC, 650.47, -21.65, -305.03, 2, math.random(0,8))
  50. MovementLoopAddLocation(NPC, 651.59, -19.68, -274.91, 2, math.random(0,8))
  51. MovementLoopAddLocation(NPC, 660.91, -19.39, -273.14, 2, math.random(0,8))
  52. MovementLoopAddLocation(NPC, 686.92, -19.49, -279.5, 2, math.random(0,8))
  53. MovementLoopAddLocation(NPC, 698.27, -17.96, -309.4, 2, math.random(0,8))
  54. MovementLoopAddLocation(NPC, 704.73, -17.06, -332.45, 2, math.random(0,8))
  55. MovementLoopAddLocation(NPC, 698.27, -17.96, -309.4, 2, math.random(0,8))
  56. MovementLoopAddLocation(NPC, 686.92, -19.49, -279.5, 2, math.random(0,8))
  57. MovementLoopAddLocation(NPC, 660.91, -19.39, -273.14, 2, math.random(0,8))
  58. MovementLoopAddLocation(NPC, 651.59, -19.68, -274.91, 2, math.random(0,8))
  59. MovementLoopAddLocation(NPC, 650.47, -21.65, -305.03, 2, math.random(0,8))
  60. MovementLoopAddLocation(NPC, 646.13, -19.97, -319.17, 2, math.random(0,8))
  61. MovementLoopAddLocation(NPC, 648.13, -13.26, -358.4, 2, math.random(0,8))
  62. end
  63. function Option1(NPC, Spawn)
  64. FaceTarget(NPC, Spawn)
  65. PlayFlavor(NPC, "voiceover/english/patrolman_fanthis/qey_elddar/patrolmanfanthis000.mp3", "", "agree", 855383288, 3555158222, Spawn)
  66. local conversation = CreateConversation()
  67. AddConversationOption(conversation, "I'll head over and pick them up for you.", "StartQuest")
  68. AddConversationOption(conversation, "Hmm, not sure I really have the time either. Sorry.")
  69. StartConversation(conversation, NPC, Spawn, "Well, since you're offering I need some arrows picked up from a shop called In-Range on the northeast side of the grove. I've been meaning to pick up the arrows for a week, but I'm too busy to spare the time.")
  70. end
  71. function StartQuest(NPC, Spawn)
  72. FaceTarget(NPC, Spawn)
  73. OfferQuest(NPC, Spawn,arrows)
  74. end
  75. function Delivered(NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. PlayFlavor(NPC, "voiceover/english/patrolman_fanthis/qey_elddar/patrolmanfanthis002.mp3", "", "thank", 3229545703, 429402997, Spawn)
  78. local conversation = CreateConversation()
  79. AddConversationOption(conversation, "It was no problem. Good luck on patrol.", "FinishQuest")
  80. StartConversation(conversation, NPC, Spawn, "Ah, yes! Perfect timing. I spent my last quiver full of arrows in practice at the range, but all of my patrols have prevented me from picking them up. ")
  81. end
  82. function FinishQuest(NPC, Spawn)
  83. FaceTarget(NPC, Spawn)
  84. SetStepComplete(Spawn,arrows, 2)
  85. end