aQeynosGuardsmanBarbarian.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/aQeynosGuardsmanBarbarian.lua
  3. Script Author : Cynnar (edited by Rylec)
  4. Script Date : 2018.10.07 10:10:32
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. AddTimer(NPC, 900, "followguard_A")
  10. local shouttime = math.random (90000,270000)
  11. AddTimer(NPC, shouttime, "shout")
  12. end
  13. function followguard_A(NPC)
  14. local zone = GetZone(NPC)
  15. local guard_A_placement = GetSpawnByLocationID(zone, 430688)
  16. local sli = GetSpawnLocationID(NPC)
  17. local leaderX = GetX(guard_A_placement)
  18. local leaderY = GetY(guard_A_placement)
  19. local leaderZ = GetZ(guard_A_placement)
  20. local speed = 2
  21. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. ", " .. GetY(guard_A_placement) .. ", " .. GetZ(guard_A_placement))
  22. if sli == 133770887 then
  23. if GetDistance(NPC, guard_A_placement) >= 8 then
  24. speed = 5
  25. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  26. else
  27. speed = 2
  28. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  29. end
  30. elseif sli == 133770888 then
  31. if GetDistance(NPC, guard_A_placement) >= 8 then
  32. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. "")
  33. -- Say(NPC, "My location is: " .. GetX(NPC) .. "")
  34. speed = 5
  35. MoveToLocation(NPC, leaderX, leaderY, leaderZ - 2, speed)
  36. else
  37. speed = 2
  38. MoveToLocation(NPC, leaderX, leaderY, leaderZ - 2, speed)
  39. end
  40. elseif sli == 133770889 then
  41. if GetDistance(NPC, guard_A_placement) >= 8 then
  42. MoveToLocation(NPC, leaderX + 2, leaderY, leaderZ, speed)
  43. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. "")
  44. -- Say(NPC, "My location is: " .. GetX(NPC) .. "")
  45. speed = 5
  46. else
  47. speed = 2
  48. MoveToLocation(NPC, leaderX + 2, leaderY, leaderZ, speed)
  49. end
  50. end
  51. speed = 2
  52. AddTimer(NPC, 3000, "followguard_A")
  53. end
  54. function hailed(NPC, Spawn)
  55. FaceTarget(NPC, Spawn)
  56. end
  57. function respawn(NPC)
  58. spawn(NPC)
  59. end
  60. function shout(NPC)
  61. math.randomseed(os.time())
  62. local choice = math.random (1,3)
  63. if choice == 1 then
  64. Say(NPC, "For the love of Halas, I could use a stout!")
  65. elseif choice == 2 then
  66. Say(NPC, "All clear here!")
  67. elseif choice == 3 then
  68. Say(NPC, "I long to return to Qeynos.")
  69. end
  70. local time = math.random (90000,2700000)
  71. AddTimer(NPC, time, "shout")
  72. end