9
3

abadgercub.lua 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. --[[
  2. Script Name : SpawnScripts/Oakmyst_Classic/abadgercub.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2023.09.22 01:09:15
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/CatalogueQuestUpdates.lua")
  9. require "SpawnScripts/Generic/NPCModule"
  10. function spawn(NPC, Spawn)
  11. NPCModule(NPC, Spawn)
  12. ChooseMovement(NPC)
  13. end
  14. function ChooseMovement(NPC)
  15. local route = math.random(1,4)
  16. if route == 1 then
  17. RouteOne(NPC, Spawn)
  18. elseif route == 2 then
  19. RouteTwo(NPC, Spawn)
  20. elseif route == 3 then
  21. RouteThree(NPC, Spawn)
  22. elseif route == 4 then
  23. RouteFour(NPC, Spawn)
  24. end
  25. end
  26. function RouteOne(NPC, Spawn)
  27. local X = GetX(NPC)
  28. local Y = GetY(NPC)
  29. local Z = GetZ(NPC)
  30. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  31. MovementLoopAddLocation(NPC, X, Y, Z, 2, 0)
  32. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, math.random(7,15))
  33. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, 0)
  34. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, math.random(7,15))
  35. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, 0)
  36. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, math.random(7,15))
  37. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, 0)
  38. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, math.random(7,15))
  39. MovementLoopAddLocation(NPC, X + 2, Y, Z + 4, 2, 0)
  40. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  41. end
  42. function RouteTwo(NPC, Spawn)
  43. local X = GetX(NPC)
  44. local Y = GetY(NPC)
  45. local Z = GetZ(NPC)
  46. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  47. MovementLoopAddLocation(NPC, X, Y, Z, 2, 0)
  48. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, math.random(7,15))
  49. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, 0)
  50. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, math.random(7,15))
  51. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, 0)
  52. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, math.random(7,15))
  53. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, 0)
  54. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, math.random(7,15))
  55. MovementLoopAddLocation(NPC, X - 2, Y, Z - 4, 2, 0)
  56. MovementLoopAddLocation(NPC, X, Y, Z, 1, math.random(7,15))
  57. end
  58. function RouteThree(NPC, Spawn)
  59. local X = GetX(NPC)
  60. local Y = GetY(NPC)
  61. local Z = GetZ(NPC)
  62. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  63. MovementLoopAddLocation(NPC, X, Y, Z, 2,0)
  64. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, math.random(7,15))
  65. MovementLoopAddLocation(NPC, X + 2, Y, Z, 2, 0)
  66. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, math.random(7,15))
  67. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, 0)
  68. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, math.random(7,15))
  69. MovementLoopAddLocation(NPC, X + 3, Y, Z, 2, 0)
  70. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, math.random(7,15))
  71. MovementLoopAddLocation(NPC, X + 2, Y, Z - 4, 2, 0)
  72. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  73. end
  74. function RouteFour(NPC, Spawn)
  75. local X = GetX(NPC)
  76. local Y = GetY(NPC)
  77. local Z = GetZ(NPC)
  78. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  79. MovementLoopAddLocation(NPC, X, Y, Z, 2, 0)
  80. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, math.random(7,15))
  81. MovementLoopAddLocation(NPC, X - 2, Y, Z, 2, 0)
  82. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, math.random(7,15))
  83. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, 0)
  84. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, math.random(7,15))
  85. MovementLoopAddLocation(NPC, X - 3, Y, Z, 2, 0)
  86. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, math.random(7,15))
  87. MovementLoopAddLocation(NPC, X - 2, Y, Z + 4, 2, 0)
  88. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(7,15))
  89. end
  90. math.random(10,15)
  91. function respawn(NPC, Spawn)
  92. spawn(NPC)
  93. end
  94. function hailed(NPC, Spawn)
  95. FaceTarget(NPC, Spawn)
  96. end