awarwolf2.lua 972 B

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