9
3

VibiusMansuetus.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --[[
  2. Script Name : SpawnScripts/Freeport/VibiusMansuetus.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.07.19 11:07:02
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  9. function spawn(NPC)
  10. AddTimer(NPC, 500, "followguard", 1)
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. GenericGuardHail(NPC, Spawn, Faction)
  15. end
  16. function respawn(NPC)
  17. end
  18. function followguard(NPC, Spawn)
  19. local zone = GetZone(NPC)
  20. local GUARD_LEADER = GetSpawnByLocationID(zone, 56909)
  21. if GUARD_LEADER ~= nil then
  22. local leaderX = GetX(GUARD_LEADER)
  23. local leaderY = GetY(GUARD_LEADER)
  24. local leaderZ = GetZ(GUARD_LEADER)
  25. local speed = 2
  26. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. ", " .. GetY(guard_A_placement) .. ", " .. GetZ(guard_A_placement))
  27. if GetDistance(NPC, GUARD_LEADER) >= 8 then
  28. speed = 5
  29. MoveToLocation(NPC, leaderX -2 , leaderY, leaderZ , speed)
  30. else
  31. speed = 2
  32. MoveToLocation(NPC, leaderX -2 , leaderY, leaderZ , speed)
  33. end
  34. AddTimer(NPC, 3000, "followguard")
  35. end
  36. end