9
3

Falkener.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/Falkener.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.21 10:06:09
  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)<15 then
  17. GenericGuardHail(NPC, Spawn)
  18. end
  19. end
  20. end
  21. function Outside(NPC, Spawn)
  22. SetHeading(NPC,73)
  23. end
  24. function Stair1(NPC, Spawn)
  25. SetHeading(NPC,188.6)
  26. end
  27. function Stair2(NPC, Spawn)
  28. SetHeading(NPC,99.8)
  29. end
  30. function hailed(NPC, Spawn)
  31. FaceTarget(NPC, Spawn)
  32. GenericGuardHail(NPC, Spawn)
  33. end
  34. function Action(NPC)
  35. local choice = MakeRandomInt(1, 4)
  36. if choice == 1 then
  37. PlayFlavor(NPC, "", "", "peer", 0, 0, Spawn)
  38. elseif choice == 2 then
  39. PlayFlavor(NPC, "", "", "listen", 0, 0, Spawn)
  40. elseif choice == 3 then
  41. PlayFlavor(NPC, "", "", "sniff", 0, 0, Spawn)
  42. elseif choice == 4 then
  43. PlayFlavor(NPC, "", "", "attention", 0, 0, Spawn)
  44. end
  45. end
  46. function waypoints(NPC)
  47. MovementLoopAddLocation(NPC, 688.42, -20.35, 336.66, 2, 1,"Outside")
  48. MovementLoopAddLocation(NPC, 688.42, -20.35, 336.66, 2, 64,"Action")
  49. MovementLoopAddLocation(NPC, 687.17, -20.32, 336.02, 2, 0)
  50. MovementLoopAddLocation(NPC, 685.79, -20.42, 331.53, 2, 0)
  51. MovementLoopAddLocation(NPC, 687.54, -20.42, 330.85, 2, 0)
  52. MovementLoopAddLocation(NPC, 692.37, -20.46, 329.73, 2, 0)
  53. MovementLoopAddLocation(NPC, 697.61, -22.38, 328.49, 2, 0)
  54. MovementLoopAddLocation(NPC, 704.45, -23.93, 326.61, 2, 1,"Stair1")
  55. MovementLoopAddLocation(NPC, 704.45, -23.93, 326.61, 2, 45,"Action")
  56. MovementLoopAddLocation(NPC, 707.9, -27.18, 341.66, 2, 1,"Stair2")
  57. MovementLoopAddLocation(NPC, 707.9, -27.18, 341.66, 2, 64,"Action")
  58. MovementLoopAddLocation(NPC, 706.99, -27.21, 341.85, 2, 0)
  59. MovementLoopAddLocation(NPC, 704.45, -27.22, 338.42, 2, 0)
  60. MovementLoopAddLocation(NPC, 702.42, -23.99, 330.82, 2, 0)
  61. MovementLoopAddLocation(NPC, 700.89, -23.75, 330.36, 2, 0)
  62. MovementLoopAddLocation(NPC, 688.25, -20.41, 333.6, 2, 0)
  63. MovementLoopAddLocation(NPC, 687.1, -20.4, 334.25, 2, 0)
  64. end