9
3

SergeantatArmsIleea.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/SergeantatArmsIleea.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.27 03:10:19
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  9. dofile("SpawnScripts/Generic/ExpelNonCitizen.lua")
  10. function spawn(NPC)
  11. AddTimer(NPC, 1900, "follow_Steelnerve")
  12. SetPlayerProximityFunction(NPC, 10, "InRange", "LeaveRange")
  13. end
  14. function InRange(NPC, Spawn)
  15. NonCitizen(NPC,Spawn)
  16. end
  17. function hailed(NPC, Spawn)
  18. if GetFactionAmount(Spawn,11)<0 then
  19. else
  20. FaceTarget(NPC, Spawn)
  21. GenericGuardHail(NPC,Spawn)
  22. end
  23. end
  24. function respawn(NPC)
  25. spawn(NPC)
  26. end
  27. function follow_Steelnerve(NPC)
  28. local zone = GetZone(NPC)
  29. local Steelnerve_location = GetSpawnByLocationID(zone, 133779453)
  30. local sli = GetSpawnLocationID(NPC)
  31. local leaderX = GetX(Steelnerve_location)
  32. local leaderY = GetY(Steelnerve_location)
  33. local leaderZ = GetZ(Steelnerve_location)
  34. local speed = 2
  35. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. ", " .. GetY(guard_A_placement) .. ", " .. GetZ(guard_A_placement))
  36. if Steelnerve_location ~=nil then
  37. if sli == 133779452 then --Ileea
  38. if GetDistance(NPC, Steelnerve_location) >= 8 then
  39. speed = 5
  40. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  41. else
  42. speed = 2
  43. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  44. end
  45. elseif sli == 133779454 then --Gnollbane
  46. if GetDistance(NPC, Steelnerve_location) >= 8 then
  47. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. "")
  48. -- Say(NPC, "My location is: " .. GetX(NPC) .. "")
  49. speed = 5
  50. MoveToLocation(NPC, leaderX, leaderY, 2+ leaderZ, speed)
  51. else
  52. speed = 2
  53. MoveToLocation(NPC, leaderX, leaderY, 2+ leaderZ, speed)
  54. end
  55. end
  56. end
  57. speed = 2
  58. AddTimer(NPC, 2000, "follow_Steelnerve")
  59. end