9
3

Kraz.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --[[
  2. Script Name : SpawnScripts/WestFreeport/Kraz.lua
  3. Script Purpose : Waypoint follw Path to Barron Narrog Bloodgulper in West Freeport
  4. Script Author : Cynnar
  5. Script Date : 01/19/2019 02:23:28 PM
  6. Script Notes : Barron Narrog Bloodgulper and Kruz
  7. --]]
  8. function spawn(NPC)
  9. AddTimer(NPC, 900, "follow_Barron")
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function follow_Barron(NPC)
  15. local zone = GetZone(NPC)
  16. local Barron_location = GetSpawnByLocationID(zone, 407149)
  17. local sli = GetSpawnLocationID(NPC)
  18. local leaderX = GetX(Barron_location)
  19. local leaderY = GetY(Barron_location)
  20. local leaderZ = GetZ(Barron_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 == 407115 then
  24. if GetDistance(NPC, Barron_location) >= 8 then
  25. speed = 5
  26. MoveToLocation(NPC, leaderX - 4, leaderY, leaderZ, speed)
  27. else
  28. speed = 2
  29. MoveToLocation(NPC, leaderX - 4, leaderY, leaderZ, speed)
  30. end
  31. elseif sli == 407155 then
  32. if GetDistance(NPC, Barron_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, 2+ leaderZ, speed)
  37. else
  38. speed = 2
  39. MoveToLocation(NPC, leaderX, leaderY, 2+ leaderZ, speed)
  40. end
  41. end
  42. speed = 2
  43. AddTimer(NPC, 3000, "follow_Barron")
  44. end
  45. function hailed(NPC, Spawn)
  46. FaceTarget(NPC, Spawn)
  47. end