9
3

amorakdevourer428718.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/amorakdevourer428718.lua
  3. Script Purpose : Follow script for amorakdevourer428718.lua
  4. Script Author : Rylec
  5. Script Date : 06-01-2020 10:08:43
  6. Script Notes : Follow script
  7. --]]
  8. function spawn(NPC)
  9. SpawnSet(NPC, "level", "3")
  10. SpawnSet(NPC, "difficulty", "2")
  11. AddTimer(NPC, 2000, "FollowMorak")
  12. end
  13. function hailed(NPC, Spawn)
  14. FaceTarget(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function FollowMorak(NPC)
  20. local zone = GetZone(NPC)
  21. local morak_location = GetSpawnByLocationID(zone, 428699)
  22. local leaderX = GetX(morak_location)
  23. local leaderY = GetY(morak_location)
  24. local leaderZ = GetZ(morak_location)
  25. local speed = 2
  26. local randdistance = math.random(1,5)
  27. local randX = math.random(1,5)
  28. local randY = math.random(1,5)
  29. local randZ = math.random(1,5)
  30. if GetDistance(NPC, morak_location) >= randdistance then
  31. MoveToLocation(NPC, leaderX - randX, leaderY + randY, leaderZ - randZ, speed)
  32. else
  33. speed = 2
  34. MoveToLocation(NPC, leaderX + 1, leaderY + 2, leaderZ - 1, speed)
  35. end
  36. speed = 2
  37. AddTimer(NPC, math.random(3000,10000), "FollowMorak")
  38. end