aQeynosGuardsman133770887.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. --[[
  2. Script Name : SpawnScripts/QueensColony/aQeynosGuardsman133770887.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. setmodel(NPC)
  10. AddTimer(NPC, 900, "followguard_A")
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function setmodel(NPC)
  19. local RandomModel = math.random (1,4)
  20. local shouttime = math.random (90,270)
  21. if RandomModel == 1 then
  22. SpawnSet(NPC, "model_type", "82")
  23. AddTimer(NPC, shouttime, "kerra")
  24. elseif RandomModel == 2 then
  25. SpawnSet(NPC, "model_type", "110")
  26. AddTimer(NPC, shouttime, "dwarf")
  27. elseif RandomModel == 3 then
  28. SpawnSet(NPC, "model_type", "112")
  29. AddTimer(NPC, shouttime, "barbarian")
  30. elseif RandomModel == 4 then
  31. SpawnSet(NPC, "model_type", "134")
  32. AddTimer(NPC, shouttime, "human")
  33. end
  34. end
  35. function followguard_A(NPC)
  36. local zone = GetZone(NPC)
  37. local guard_A_placement = GetSpawnByLocationID(zone, 430688)
  38. local sli = GetSpawnLocationID(NPC)
  39. local leaderX = GetX(guard_A_placement)
  40. local leaderY = GetY(guard_A_placement)
  41. local leaderZ = GetZ(guard_A_placement)
  42. local speed = 2
  43. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. ", " .. GetY(guard_A_placement) .. ", " .. GetZ(guard_A_placement))
  44. if sli == 133770887 then
  45. if GetDistance(NPC, guard_A_placement) >= 8 then
  46. speed = 5
  47. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  48. else
  49. speed = 2
  50. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  51. end
  52. elseif sli == 133770888 then
  53. if GetDistance(NPC, guard_A_placement) >= 8 then
  54. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. "")
  55. -- Say(NPC, "My location is: " .. GetX(NPC) .. "")
  56. speed = 5
  57. MoveToLocation(NPC, leaderX, leaderY, leaderZ - 2, speed)
  58. else
  59. speed = 2
  60. MoveToLocation(NPC, leaderX, leaderY, leaderZ - 2, speed)
  61. end
  62. elseif sli == 133770889 then
  63. if GetDistance(NPC, guard_A_placement) >= 8 then
  64. MoveToLocation(NPC, leaderX + 2, leaderY, leaderZ, speed)
  65. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. "")
  66. -- Say(NPC, "My location is: " .. GetX(NPC) .. "")
  67. speed = 5
  68. else
  69. speed = 2
  70. MoveToLocation(NPC, leaderX + 2, leaderY, leaderZ, speed)
  71. end
  72. end
  73. speed = 2
  74. AddTimer(NPC, 3000, "followguard_A")
  75. end
  76. function kerra(NPC)
  77. math.randomseed(os.time())
  78. local choice = math.random (1,3)
  79. if choice == 1 then
  80. Say(NPC, "Wraaaaa!")
  81. elseif choice == 2 then
  82. Say(NPC, "For Qeynos!")
  83. elseif choice == 3 then
  84. Say(NPC, "Look at Luclin! Shar Vahl...")
  85. Emote(NPC, "groans.")
  86. end
  87. local time = math.random (90000,2700000)
  88. AddTimer(NPC, time, "kerra")
  89. end
  90. function dwarf(NPC)
  91. math.randomseed(os.time())
  92. local choice = math.random (1,3)
  93. if choice == 1 then
  94. Say(NPC, "When I am off duty that rock is mine!")
  95. Emote(NPC, "points at a shiny stone.")
  96. elseif choice == 2 then
  97. Say(NPC, "For the strength of Kaladim!")
  98. elseif choice == 3 then
  99. Say(NPC, "Onward boys and keep in line!")
  100. end
  101. local time = math.random (90000,2700000)
  102. AddTimer(NPC, time, "dwarf")
  103. end
  104. function barbarian(NPC)
  105. math.randomseed(os.time())
  106. local choice = math.random (1,3)
  107. if choice == 1 then
  108. Say(NPC, "For the love of Halas, I could use a stout!")
  109. elseif choice == 2 then
  110. Say(NPC, "All clear here!")
  111. elseif choice == 3 then
  112. Say(NPC, "I long to return to Qeynos.")
  113. end
  114. local time = math.random (90000,2700000)
  115. AddTimer(NPC, time, "barbarian")
  116. end
  117. function human(NPC)
  118. math.randomseed(os.time())
  119. local choice = math.random (1,3)
  120. if choice == 1 then
  121. Say(NPC, "I'll bet you an ale that I spot the next intruder first.")
  122. Emote(NPC, "smack his fist into his palm.")
  123. elseif choice == 2 then
  124. Say(NPC, "In honor of the Queen.")
  125. Emote(NPC, "salutes.")
  126. elseif choice == 3 then
  127. Say(NPC, "Keep your eyes peeled boys!")
  128. end
  129. local time = math.random (90000,2700000)
  130. AddTimer(NPC, time, "human")
  131. end