9
3

anOakmystspirit.lua 3.2 KB

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