afallenpirateR.lua 3.2 KB

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