9
3

AFangedSentinel55728.lua 1.1 KB

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