awarwolf4.lua 919 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/awarwolf4.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.09.14 04:09:01
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. AddTimer(NPC, 1000, "followsentry")
  10. end
  11. function hailed(NPC, Spawn)
  12. FaceTarget(NPC, Spawn)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function followsentry(NPC)
  18. local zone = GetZone(NPC)
  19. local sentry_location = GetSpawnByLocationID(zone, 133775567)
  20. local leaderX = GetX(sentry_location)
  21. local leaderY = GetY(sentry_location)
  22. local leaderZ = GetZ(sentry_location)
  23. local speed = 2
  24. if sentry_location ~=nil and not IsInCombat(NPC) then
  25. if GetDistance(NPC, sentry_location) >= 2 then
  26. speed = 2
  27. MoveToLocation(NPC, leaderX, leaderY, leaderZ, speed)
  28. end
  29. end
  30. AddTimer(NPC, 1500, "followsentry")
  31. end