9
3

aLonetusksentry.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. --[[
  2. Script Name : SpawnScripts/Ruins/aLonetusksentry.lua
  3. Script Purpose : a Lonetusk sentry
  4. Script Author : Scatman
  5. Script Date : 2009.08.21
  6. Script Notes :
  7. --]]
  8. dofile("SpawnScripts/Ruins/aLonetuskBloodseer.lua")
  9. local spoke = false
  10. function spawn(NPC)
  11. spoke = false
  12. local sli = GetSpawnLocationID(NPC)
  13. if sli == 159752 then
  14. StartPath1(NPC)
  15. elseif sli == 133494 then
  16. StartPath2(NPC)
  17. elseif sli == 133485 then
  18. StartPath3(NPC)
  19. elseif sli == 159753 or sli == 159754 then
  20. StartPath4(NPC)
  21. elseif sli == 159755 then
  22. -- ^^ wanderer
  23. StartPath5(NPC)
  24. end
  25. end
  26. function respawn(NPC)
  27. spawn(NPC)
  28. end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. end
  32. function aggro(NPC, Spawn)
  33. local chance = math.random(0, 100)
  34. if chance <= 25 then
  35. generic_aggro(NPC, Spawn)
  36. end
  37. end
  38. function healthchanged(NPC, Spawn)
  39. local chance = math.random(0, 100)
  40. if chance <= 25 then
  41. local health_percent = GetHP(NPC) / GetMaxHP(NPC)
  42. if health_percent < 0.50 and spoke == false then
  43. spoke = true
  44. generic_healthchanged(NPC, Spawn)
  45. end
  46. end
  47. end
  48. function killed(NPC, Spawn)
  49. generic_killed(NPC, Spawn)
  50. end
  51. function death(NPC, Spawn)
  52. spoke = false
  53. local chance = math.random(0, 100)
  54. if chance <= 25 then
  55. generic_death(NPC, Spawn)
  56. end
  57. end
  58. function StartPath1(NPC)
  59. MovementLoopAddLocation(NPC, -41.32, -3.74, 120.32, 2, 0)
  60. MovementLoopAddLocation(NPC, -65.94, -2.47, 99.71, 2, 0)
  61. MovementLoopAddLocation(NPC, -77.68, -2.43, 99, 2, 0)
  62. MovementLoopAddLocation(NPC, -77.79, -2.57, 104.14, 2, 0)
  63. MovementLoopAddLocation(NPC, -66.54, -2.66, 106.48, 2, 0)
  64. MovementLoopAddLocation(NPC, -57.71, -2.76, 111.01, 2, 0)
  65. MovementLoopAddLocation(NPC, -53.14, -2.68, 118.32, 2, 0)
  66. MovementLoopAddLocation(NPC, -44.23, -3.49, 126.27, 2, 0)
  67. MovementLoopAddLocation(NPC, -32.83, -4.42, 141.49, 2, 0)
  68. MovementLoopAddLocation(NPC, -28.68, -4.42, 156.88, 2, 0)
  69. end
  70. function StartPath2(NPC)
  71. MovementLoopAddLocation(NPC, -67.64, -2.42, 100.51, 2, 0)
  72. MovementLoopAddLocation(NPC, -50.99, -3.03, 109.9, 2, 0)
  73. MovementLoopAddLocation(NPC, -34.21, -4.28, 133.12, 2, 0)
  74. MovementLoopAddLocation(NPC, -21.44, -4.35, 145.14, 2, 0)
  75. MovementLoopAddLocation(NPC, -28.3, -4.42, 150.16, 2, 0)
  76. MovementLoopAddLocation(NPC, -29.34, -4.32, 143.17, 2, 0)
  77. MovementLoopAddLocation(NPC, -43.55, -3.54, 127, 2, 0)
  78. MovementLoopAddLocation(NPC, -50.41, -2.84, 121.45, 2, 0)
  79. MovementLoopAddLocation(NPC, -52.63, -2.77, 114.84, 2, 0)
  80. MovementLoopAddLocation(NPC, -75.87, -2.49, 103.47, 2, 0)
  81. MovementLoopAddLocation(NPC, -77.35, -2.45, 98.34, 2, 0)
  82. end
  83. function StartPath3(NPC)
  84. MovementLoopAddLocation(NPC, -94.78, -1.3, 131.55, 2, 0)
  85. MovementLoopAddLocation(NPC, -88.14, -1.48, 131.68, 2, 0)
  86. MovementLoopAddLocation(NPC, -87.84, -1.52, 127.62, 2, 0)
  87. MovementLoopAddLocation(NPC, -88.6, -2.61, 112.67, 2, 0)
  88. MovementLoopAddLocation(NPC, -80.61, -2.54, 104.52, 2, 0)
  89. MovementLoopAddLocation(NPC, -83.55, -2.47, 101.98, 2, 0)
  90. MovementLoopAddLocation(NPC, -91.03, -2.48, 110.27, 2, 0)
  91. MovementLoopAddLocation(NPC, -92.3, -2.59, 113.78, 2, 0)
  92. MovementLoopAddLocation(NPC, -92, -1.54, 128.43, 2, 0)
  93. MovementLoopAddLocation(NPC, -94.87, -1.32, 130.14, 2, 0)
  94. MovementLoopAddLocation(NPC, -95.15, -1.28, 131.86, 2, 0)
  95. end
  96. function StartPath4(NPC)
  97. MovementLoopAddLocation(NPC, -50.43, -3.04, 100.97, 4, 0)
  98. MovementLoopAddLocation(NPC, -44.55, -3.31, 96.16, 4, 0)
  99. MovementLoopAddLocation(NPC, -36.75, -3.59, 94.58, 4, 0)
  100. MovementLoopAddLocation(NPC, -22.18, -3.82, 109.96, 4, 0)
  101. MovementLoopAddLocation(NPC, -19.79, -4.38, 123.6, 4, 0)
  102. MovementLoopAddLocation(NPC, -3.78, -4.27, 119.49, 4, 0)
  103. MovementLoopAddLocation(NPC, -5.81, -4.42, 106.36, 4, 0)
  104. MovementLoopAddLocation(NPC, 7.25, -3.84, 81.62, 4, 0)
  105. MovementLoopAddLocation(NPC, -3.5, -4.24, 75.01, 4, 0)
  106. MovementLoopAddLocation(NPC, -7.39, -4.48, 45.03, 4, 0)
  107. MovementLoopAddLocation(NPC, 4.13, -4.02, 40.35, 4, 0)
  108. MovementLoopAddLocation(NPC, -14.54, -5.17, 32.26, 4, 0)
  109. MovementLoopAddLocation(NPC, -18.62, -5.31, 38.18, 4, 0)
  110. MovementLoopAddLocation(NPC, -8.9, -4.24, 57.35, 4, 0)
  111. MovementLoopAddLocation(NPC, -22.65, -4.03, 77.66, 4, 0)
  112. MovementLoopAddLocation(NPC, -26, -4.08, 100.43, 4, 0)
  113. MovementLoopAddLocation(NPC, -29.41, -3.83, 101.3, 4, 0)
  114. MovementLoopAddLocation(NPC, -41.86, -3.41, 95.6, 4, 0)
  115. MovementLoopAddLocation(NPC, -52.15, -2.89, 100.89, 4, 0)
  116. MovementLoopAddLocation(NPC, -44.28, -3.35, 115.19, 4, 0)
  117. end
  118. function StartPath5(NPC)
  119. MovementLoopAddLocation(NPC, -56.31, -2.52, 138.86, 4, math.random(0, 15))
  120. MovementLoopAddLocation(NPC, -45.55, -2.62, 138.2, 4, math.random(0, 15))
  121. MovementLoopAddLocation(NPC, -63.53, -2.66, 149.64, 4, math.random(0, 15))
  122. MovementLoopAddLocation(NPC, -61.63, -2.66, 163.37, 4, math.random(0, 15))
  123. MovementLoopAddLocation(NPC, -58.97, -2.67, 153.47, 4, math.random(0, 15))
  124. MovementLoopAddLocation(NPC, -52.19, -2.67, 155.04, 4, math.random(0, 15))
  125. MovementLoopAddLocation(NPC, -45.12, -2.72, 147.89, 4, math.random(0, 15))
  126. MovementLoopAddLocation(NPC, -44.97, -3.32, 127.2, 4, math.random(0, 15))
  127. MovementLoopAddLocation(NPC, -57.75, -2.65, 144.9, 4, math.random(0, 15))
  128. MovementLoopAddLocation(NPC, -52.23, -2.67, 158.43, 4, math.random(0, 15))
  129. end