amorakdevourer428718.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. SpawnSet(NPC, "hp", 30)
  12. SpawnSet(NPC, "power", 15)
  13. AddTimer(NPC, 2000, "FollowMorak")
  14. end
  15. function hailed(NPC, Spawn)
  16. FaceTarget(NPC, Spawn)
  17. end
  18. function respawn(NPC)
  19. spawn(NPC)
  20. end
  21. function FollowMorak(NPC)
  22. local zone = GetZone(NPC)
  23. local morak_location = GetSpawnByLocationID(zone, 428699)
  24. local leaderX = GetX(morak_location)
  25. local leaderY = GetY(morak_location)
  26. local leaderZ = GetZ(morak_location)
  27. local speed = 2
  28. local randdistance = math.random(1,5)
  29. local randX = math.random(1,5)
  30. local randY = math.random(1,5)
  31. local randZ = math.random(1,5)
  32. if GetDistance(NPC, morak_location) >= randdistance then
  33. MoveToLocation(NPC, leaderX - randX, leaderY + randY, leaderZ - randZ, speed)
  34. else
  35. speed = 2
  36. MoveToLocation(NPC, leaderX + 1, leaderY + 2, leaderZ - 1, speed)
  37. end
  38. speed = 2
  39. AddTimer(NPC, math.random(3000,10000), "FollowMorak")
  40. end