9
3

awarwolf1.lua 997 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --[[
  2. Script Name : SpawnScripts/IsleRefuge1/awarwolf1.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.09.14 02:09:48
  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. FaceTarget(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function followsentry(NPC)
  20. local zone = GetZone(NPC)
  21. local sentry_location = GetSpawnByLocationID(zone, 133775505)
  22. local leaderX = GetX(sentry_location)
  23. local leaderY = GetY(sentry_location)
  24. local leaderZ = GetZ(sentry_location)
  25. local speed = 2
  26. if sentry_location ~=nil and not IsInCombat(NPC) then
  27. if GetDistance(NPC, sentry_location) >= 2 then
  28. speed = 2
  29. MoveToLocation(NPC, leaderX, leaderY, leaderZ, speed)
  30. end
  31. end
  32. AddTimer(NPC, 1500, "followsentry")
  33. end