aQeynosGuardsmanDwarf.lua 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/aQeynosGuardsmanDwarf.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, "When I am off duty that rock is mine!")
  65. Emote(NPC, "points at a shiny stone.")
  66. elseif choice == 2 then
  67. Say(NPC, "For the strength of Kaladim!")
  68. elseif choice == 3 then
  69. Say(NPC, "Onward boys and keep in line!")
  70. end
  71. local time = math.random (90000,2700000)
  72. AddTimer(NPC, time, "shout")
  73. end