9
3

Gnollbane.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --[[
  2. Script Name : SpawnScripts/SouthQeynos/Gnollbane.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.10.27 03:10:44
  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