9
3

aQeynosGuardsmanDwarfRight.lua 2.8 KB

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