Sanooielo.lua 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/Sanooielo.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.21 12:06:35
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  9. function spawn(NPC)
  10. waypoints(NPC)
  11. SetPlayerProximityFunction(NPC, 7, "InRange", "LeaveRange")
  12. end
  13. function InRange(NPC, Spawn)
  14. CheckFaction(NPC, Spawn, "Qeynos")
  15. if GetFactionAmount(Spawn,11)>0 then
  16. if math.random(1,100)<25 then
  17. GenericGuardHail(NPC, Spawn)
  18. end
  19. end
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. GenericGuardHail(NPC, Spawn)
  24. end
  25. function respawn(NPC)
  26. spawn(NPC)
  27. end
  28. function FaceStreet(NPC)
  29. SpawnSet(NPC, "heading", "289")
  30. end
  31. function waypoints(NPC)
  32. MovementLoopAddLocation(NPC, 655.09, -20.42, 304.56, 2, 1,"FaceStreet")
  33. MovementLoopAddLocation(NPC, 655.09, -20.42, 304.56, 2, 25,"Action")
  34. MovementLoopAddLocation(NPC, 655.09, -20.42, 304.56, 2, 25,"Action")
  35. MovementLoopAddLocation(NPC, 657.15, -20.42, 301.78, 2, 0)
  36. MovementLoopAddLocation(NPC, 656.52, -20.42, 298.86, 2, 0)
  37. MovementLoopAddLocation(NPC, 654.3, -20.42, 299.03, 2, 0)
  38. MovementLoopAddLocation(NPC, 648.47, -20.46, 297.16, 2, 0)
  39. MovementLoopAddLocation(NPC, 641.88, -20.59, 300.29, 2, 0)
  40. MovementLoopAddLocation(NPC, 636.4, -20.67, 302.89, 2, 0)
  41. MovementLoopAddLocation(NPC, 629.07, -20.62, 307.18, 2, 0)
  42. MovementLoopAddLocation(NPC, 623.98, -20.53, 310.56, 2, 0)
  43. MovementLoopAddLocation(NPC, 612.92, -20.6, 322.49, 2, 1)
  44. MovementLoopAddLocation(NPC, 612.92, -20.6, 322.49, 2, 15,"Action")
  45. MovementLoopAddLocation(NPC, 605.71, -20.66, 334.49, 2, 0)
  46. MovementLoopAddLocation(NPC, 601.62, -20.76, 343.68, 2, 1)
  47. MovementLoopAddLocation(NPC, 601.62, -20.76, 343.68, 2, 25,"Action")
  48. MovementLoopAddLocation(NPC, 602.79, -20.81, 345.99, 2, 0)
  49. MovementLoopAddLocation(NPC, 604.14, -20.78, 338.99, 2, 0)
  50. MovementLoopAddLocation(NPC, 606.87, -20.69, 329.69, 2, 0)
  51. MovementLoopAddLocation(NPC, 613.54, -20.57, 320.71, 2, 0)
  52. MovementLoopAddLocation(NPC, 620.37, -20.49, 312.91, 2, 0)
  53. MovementLoopAddLocation(NPC, 633.33, -20.72, 304.47, 2, 1)
  54. MovementLoopAddLocation(NPC, 633.33, -20.72, 304.47, 2, 15,"Action")
  55. MovementLoopAddLocation(NPC, 633.33, -20.72, 304.47, 2, 15,"Action")
  56. MovementLoopAddLocation(NPC, 640.32, -20.64, 300.67, 2, 0)
  57. MovementLoopAddLocation(NPC, 648.12, -20.47, 297.01, 2, 0)
  58. MovementLoopAddLocation(NPC, 649.85, -20.43, 296.58, 2, 0)
  59. MovementLoopAddLocation(NPC, 655.82, -20.42, 298.78, 2, 0)
  60. end
  61. function Action(NPC)
  62. local choice = MakeRandomInt(1, 4)
  63. if choice == 1 then
  64. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn)
  65. elseif choice == 2 then
  66. PlayFlavor(NPC, "", "", "listen", 0, 0, Spawn)
  67. elseif choice == 3 then
  68. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  69. elseif choice == 4 then
  70. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  71. end
  72. end