awoodlandbadger.lua 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. --[[
  2. Script Name : SpawnScripts/Classic_forest/awoodlandbadger.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.10.10 10:10:43
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. local Level = GetLevel(NPC)
  10. local level1 = 3
  11. local level2 = 4
  12. local level3 = 5
  13. local difficulty1 = 6
  14. local hp1 = 75
  15. local power1 = 45
  16. local difficulty2 = 6
  17. local hp2 = 110
  18. local power2 = 55
  19. local difficulty3 =6
  20. local hp3 = 130
  21. local power3 = 65
  22. if Level == level1 then
  23. SpawnSet(NPC, "difficulty", difficulty1)
  24. SpawnSet(NPC, "hp", hp1)
  25. SpawnSet(NPC, "power", power1)
  26. elseif Level == level2
  27. then
  28. SpawnSet(NPC, "difficulty", difficulty2)
  29. SpawnSet(NPC, "hp", hp2)
  30. SpawnSet(NPC, "power", power2)
  31. elseif Level == level3
  32. then
  33. SpawnSet(NPC, "difficulty", difficulty3)
  34. SpawnSet(NPC, "hp", hp3)
  35. SpawnSet(NPC, "power", power3)
  36. end
  37. ChooseMovement(NPC)
  38. end
  39. function ChooseMovement(NPC)
  40. local route = math.random(1,4)
  41. if route == 1 then
  42. RouteOne(NPC, Spawn)
  43. elseif route == 2 then
  44. RouteTwo(NPC, Spawn)
  45. elseif route == 3 then
  46. RouteThree(NPC, Spawn)
  47. elseif route == 4 then
  48. RouteFour(NPC, Spawn)
  49. end
  50. end
  51. function RouteOne(NPC, Spawn)
  52. local X = GetX(NPC)
  53. local Y = GetY(NPC)
  54. local Z = GetZ(NPC)
  55. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  56. MovementLoopAddLocation(NPC, X + 5, Y, Z, 2,math.random(5,10))
  57. MovementLoopAddLocation(NPC, X + 5, Y, Z + 4, 2, math.random(5,10))
  58. MovementLoopAddLocation(NPC, X + 6, Y, Z, 2, math.random(5,10))
  59. MovementLoopAddLocation(NPC, X + 5, Y, Z + 4, 2, math.random(5,10))
  60. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  61. end
  62. function RouteTwo(NPC, Spawn)
  63. local X = GetX(NPC)
  64. local Y = GetY(NPC)
  65. local Z = GetZ(NPC)
  66. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  67. MovementLoopAddLocation(NPC, X - 5, Y, Z, 2, math.random(5,10))
  68. MovementLoopAddLocation(NPC, X - 5, Y, Z - 4, 2, math.random(5,10))
  69. MovementLoopAddLocation(NPC, X - 6, Y, Z, 2, math.random(5,10))
  70. MovementLoopAddLocation(NPC, X - 5, Y, Z - 4, 2, math.random(5,10))
  71. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  72. end
  73. function RouteThree(NPC, Spawn)
  74. local X = GetX(NPC)
  75. local Y = GetY(NPC)
  76. local Z = GetZ(NPC)
  77. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  78. MovementLoopAddLocation(NPC, X + 5, Y, Z, 2, math.random(5,10))
  79. MovementLoopAddLocation(NPC, X + 5, Y, Z - 4, 2, math.random(5,10))
  80. MovementLoopAddLocation(NPC, X + 6, Y, Z, 2, math.random(5,10))
  81. MovementLoopAddLocation(NPC, X + 5, Y, Z - 4, 2, math.random(5,10))
  82. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  83. end
  84. function RouteFour(NPC, Spawn)
  85. local X = GetX(NPC)
  86. local Y = GetY(NPC)
  87. local Z = GetZ(NPC)
  88. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  89. MovementLoopAddLocation(NPC, X - 5, Y, Z, 2, math.random(5,10))
  90. MovementLoopAddLocation(NPC, X - 5, Y, Z + 4, 2, math.random(5,10))
  91. MovementLoopAddLocation(NPC, X - 6, Y, Z, 2, math.random(5,10))
  92. MovementLoopAddLocation(NPC, X - 5, Y, Z + 4, 2, math.random(5,10))
  93. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,10))
  94. end
  95. function respawn(NPC, Spawn)
  96. spawn(NPC)
  97. end
  98. function hailed(NPC, Spawn)
  99. FaceTarget(NPC, Spawn)
  100. end