9
3

Patrol_Follow_Panilia.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --[[
  2. Script Name : Patrol_Follow_Panilia.lua
  3. Script Purpose : Waypoint follw Path to Panilia L`Un in West Freeport
  4. Script Author : Cynnar
  5. Script Date : 01/19/2019 02:23:28 PM
  6. Script Notes : Verus Caldus and Desia
  7. --]]
  8. function spawn(NPC)
  9. AddTimer(NPC, 900, "follow_Panilia")
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function follow_Panilia(NPC)
  15. local zone = GetZone(NPC)
  16. local Panilia_location = GetSpawnByLocationID(zone, 407347)
  17. local sli = GetSpawnLocationID(NPC)
  18. local leaderX = GetX(Panilia_location)
  19. local leaderY = GetY(Panilia_location)
  20. local leaderZ = GetZ(Panilia_location)
  21. local speed = 2
  22. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. ", " .. GetY(guard_A_placement) .. ", " .. GetZ(guard_A_placement))
  23. if sli == 407362 then
  24. if GetDistance(NPC, Panilia_location) >= 8 then
  25. speed = 5
  26. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  27. else
  28. speed = 2
  29. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  30. end
  31. elseif sli == 407375 then
  32. if GetDistance(NPC, Panilia_location) >= 8 then
  33. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. "")
  34. -- Say(NPC, "My location is: " .. GetX(NPC) .. "")
  35. speed = 5
  36. MoveToLocation(NPC, leaderX, leaderY, leaderZ - 2, speed)
  37. else
  38. speed = 2
  39. MoveToLocation(NPC, leaderX, leaderY, leaderZ - 2, speed)
  40. end
  41. end
  42. speed = 2
  43. AddTimer(NPC, 3000, "follow_Panilia")
  44. end
  45. function hailed(NPC, Spawn)
  46. FaceTarget(NPC, Spawn)
  47. end