Greenlock.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/Greenlock.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.08.23 02:08:30
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericEcologyVoiceOvers.lua")
  9. function spawn(NPC)
  10. waypoints(NPC)
  11. SetPlayerProximityFunction(NPC, 6, "InRange", "LeaveRange")
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. GenericRaceCheckHail(NPC, Spawn, faction)
  16. end
  17. function InRange(NPC,Spawn)
  18. GenericRaceCheckCallout(NPC, Spawn, faction)
  19. end
  20. function respawn(NPC)
  21. spawn(NPC)
  22. end
  23. function InitialPause(NPC)
  24. local GatherSpawn = GetSpawn(NPC, 2380178) -- Get Greenlock
  25. math.randomseed(os.time())
  26. local pause = MakeRandomInt (1, 4)
  27. if pause == 1 then
  28. AddTimer(NPC, 100, "stop_gathering")
  29. else
  30. AddTimer(NPC, 1000, "Gather")
  31. end
  32. end
  33. function Gather(NPC)
  34. local GatherSpawn = GetSpawn(NPC, 2380178) -- Get Greenlock
  35. PlayFlavor(NPC,"","","gathering_search",0,0)
  36. AddTimer(NPC, 8000, "Collect") -- for 5 seconds, then stop
  37. end
  38. function Collect(NPC)
  39. local GatherSpawn = GetSpawn(NPC, 2380178) -- Get Greenlock
  40. PlayFlavor(NPC,"","","gathering_success",0,0)
  41. AddTimer(NPC, 2000, "stop_gathering") -- for 5 seconds, then stop
  42. end
  43. function stop_gathering(NPC)
  44. local GatherSpawn = GetSpawn(NPC, 2380178) -- get Greenlock
  45. SpawnSet(NPC, "visual_state", "0") -- Stop her from gathering
  46. end
  47. function waypoints(NPC)
  48. MovementLoopAddLocation(NPC, 863.3, -18.07, -489.69, 2, 1)
  49. MovementLoopAddLocation(NPC, 863.3, -18.07, -489.69, 2, 15,"InitialPause")
  50. MovementLoopAddLocation(NPC, 863.3, -18.07, -489.69, 2, 15,"InitialPause")
  51. MovementLoopAddLocation(NPC, 861.48, -18.18, -488.55, 2, 0)
  52. MovementLoopAddLocation(NPC, 858.6, -18.31, -487.27, 2, 0)
  53. MovementLoopAddLocation(NPC, 856.72, -18.31, -489.12, 2, 1)
  54. MovementLoopAddLocation(NPC, 856.72, -18.31, -489.12, 2, 15,"InitialPause")
  55. MovementLoopAddLocation(NPC, 855.96, -18.35, -489.87, 2, 0)
  56. MovementLoopAddLocation(NPC, 855.54, -18.36, -489.34, 2, 0)
  57. MovementLoopAddLocation(NPC, 858.39, -18.3, -487.55, 2, 0)
  58. MovementLoopAddLocation(NPC, 860.47, -18.25, -487.33, 2, 0)
  59. MovementLoopAddLocation(NPC, 865.95, -17.97, -490.66, 2, 0)
  60. MovementLoopAddLocation(NPC, 869.76, -17.84, -493.08, 2, 0)
  61. MovementLoopAddLocation(NPC, 873.95, -17.21, -501.88, 2, 0)
  62. MovementLoopAddLocation(NPC, 876.84, -17.47, -508.33, 2, 0)
  63. MovementLoopAddLocation(NPC, 872.82, -16.74, -516.3, 2, 0)
  64. MovementLoopAddLocation(NPC, 875.35, -15.75, -525.65, 2, 1)
  65. MovementLoopAddLocation(NPC, 875.35, -15.75, -525.65, 2, 15,"InitialPause")
  66. MovementLoopAddLocation(NPC, 875.35, -15.75, -525.65, 2, 15,"InitialPause")
  67. MovementLoopAddLocation(NPC, 875.98, -15.7, -525.97, 2, 0)
  68. MovementLoopAddLocation(NPC, 888.59, -15.75, -522.64, 2, 0)
  69. MovementLoopAddLocation(NPC, 898.17, -16.97, -517.9, 2, 1)
  70. MovementLoopAddLocation(NPC, 898.17, -16.97, -517.9, 2, 15,"InitialPause")
  71. MovementLoopAddLocation(NPC, 898.17, -16.97, -517.9, 2, 15,"InitialPause")
  72. MovementLoopAddLocation(NPC, 901.17, -17.11, -514.09, 2, 0)
  73. MovementLoopAddLocation(NPC, 901.13, -17.33, -511.68, 2, 0)
  74. MovementLoopAddLocation(NPC, 898.64, -17.8, -501.92, 2, 1)
  75. MovementLoopAddLocation(NPC, 898.64, -17.8, -501.92, 2, 15,"InitialPause")
  76. MovementLoopAddLocation(NPC, 897.25, -17.5, -503.68, 2, 0)
  77. MovementLoopAddLocation(NPC, 890.77, -16.82, -507.95, 2, 0)
  78. MovementLoopAddLocation(NPC, 887.64, -16.55, -509.98, 2, 0)
  79. MovementLoopAddLocation(NPC, 885.21, -16.57, -511.26, 2, 0)
  80. MovementLoopAddLocation(NPC, 879.02, -17.27, -507.94, 2, 0)
  81. MovementLoopAddLocation(NPC, 875.57, -17.19, -503.07, 2, 0)
  82. MovementLoopAddLocation(NPC, 874.43, -17.84, -499.01, 2, 0)
  83. MovementLoopAddLocation(NPC, 874.95, -17.87, -495.51, 2, 1)
  84. MovementLoopAddLocation(NPC, 874.95, -17.87, -495.51, 2, 15,"InitialPause")
  85. MovementLoopAddLocation(NPC, 874.95, -17.87, -495.51, 2, 15,"InitialPause")
  86. MovementLoopAddLocation(NPC, 873.22, -17.86, -493.1, 2, 0)
  87. MovementLoopAddLocation(NPC, 865.57, -17.98, -487.95, 2, 0)
  88. MovementLoopAddLocation(NPC, 863.79, -18.3, -484.5, 2, 0)
  89. MovementLoopAddLocation(NPC, 865.49, -18.92, -478.71, 2, 0)
  90. MovementLoopAddLocation(NPC, 864.26, -18.25, -473.42, 2, 0)
  91. MovementLoopAddLocation(NPC, 861.88, -19.12, -469.21, 2, 0)
  92. MovementLoopAddLocation(NPC, 857.81, -18.95, -469.46, 2, 1)
  93. MovementLoopAddLocation(NPC, 857.81, -18.95, -469.46, 2, 15,"InitialPause")
  94. MovementLoopAddLocation(NPC, 857.81, -18.95, -469.46, 2, 15,"InitialPause")
  95. MovementLoopAddLocation(NPC, 856.81, -19.09, -470.84, 2, 0)
  96. MovementLoopAddLocation(NPC, 860.35, -18.99, -467.29, 2, 0)
  97. MovementLoopAddLocation(NPC, 862.39, -18.21, -472.86, 2, 0)
  98. MovementLoopAddLocation(NPC, 864.93, -19.12, -477.59, 2, 0)
  99. MovementLoopAddLocation(NPC, 862.96, -18.91, -479.51, 2, 0)
  100. MovementLoopAddLocation(NPC, 859.01, -18.73, -480.24, 2, 1)
  101. MovementLoopAddLocation(NPC, 859.01, -18.73, -480.24, 2, 15,"InitialPause")
  102. MovementLoopAddLocation(NPC, 858.02, -18.76, -480.42, 2, 0)
  103. MovementLoopAddLocation(NPC, 857.69, -18.68, -482.16, 2, 0)
  104. MovementLoopAddLocation(NPC, 860.08, -18.37, -485.71, 2, 0)
  105. end