9
3

amorakdevourer1587724.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/amorakdevourer1587724.lua
  3. Script Purpose : Follow script for amorakdevourer1587724.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. local level = GetLevel(NPC)
  10. if level == 4 then
  11. SpawnSet(NPC, "size", "28.8")
  12. SpawnSet(NPC, "hp", 35)
  13. SpawnSet(NPC, "power", 20)
  14. end
  15. SpawnSet(NPC, "difficulty", "2")
  16. AddTimer(NPC, 2000, "FollowMorak")
  17. end
  18. function hailed(NPC, Spawn)
  19. FaceTarget(NPC, Spawn)
  20. end
  21. function respawn(NPC)
  22. spawn(NPC)
  23. end
  24. function FollowMorak(NPC)
  25. local zone = GetZone(NPC)
  26. local morak_location = GetSpawnByLocationID(zone, 1587723)
  27. local leaderX = GetX(morak_location)
  28. local leaderY = GetY(morak_location)
  29. local leaderZ = GetZ(morak_location)
  30. local speed = 2
  31. local randdistance = math.random(1,5)
  32. local randX = math.random(1,5)
  33. local randY = math.random(1,5)
  34. local randZ = math.random(1,5)
  35. if GetDistance(NPC, morak_location) >= randdistance then
  36. MoveToLocation(NPC, leaderX - randX, leaderY + randY, leaderZ - randZ, speed)
  37. else
  38. speed = 2
  39. MoveToLocation(NPC, leaderX + 1, leaderY + 2, leaderZ - 1, speed)
  40. end
  41. speed = 2
  42. AddTimer(NPC, math.random(3000,10000), "FollowMorak")
  43. end