Fish.lua 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/Fish.lua
  3. Script Author : LordPazuzu
  4. Script Date : 2022.06.09 10:06:56
  5. Script Purpose :
  6. :
  7. --]]
  8. function hailed(NPC, Spawn)
  9. FaceTarget(NPC, Spawn)
  10. end
  11. function spawn(NPC)
  12. local Level = GetLevel(NPC)
  13. local level1 =7
  14. local level2 = 8
  15. local difficulty1 = 5
  16. local hp1 = 125
  17. local power1 = 55
  18. local difficulty2 = 5
  19. local hp2 = 145
  20. local power2 = 65
  21. if Level == level1 then
  22. SpawnSet(NPC, "difficulty", difficulty1)
  23. SpawnSet(NPC, "hp", hp1)
  24. SpawnSet(NPC, "power", power1)
  25. elseif Level == level2
  26. then
  27. SpawnSet(NPC, "difficulty", difficulty2)
  28. SpawnSet(NPC, "hp", hp2)
  29. SpawnSet(NPC, "power", power2)
  30. end
  31. ChooseMovement(NPC)
  32. end
  33. function respawn(NPC)
  34. end
  35. function ChooseMovement(NPC)
  36. local route = math.random(1,4)
  37. if route == 1 then
  38. Route1(NPC)
  39. elseif route == 2 then
  40. Route2(NPC)
  41. elseif route == 3 then
  42. Route3(NPC)
  43. elseif route == 4 then
  44. Route4(NPC)
  45. end
  46. end
  47. function Route1(NPC)
  48. local X = GetX(NPC)
  49. local Y = GetY(NPC)
  50. local Z = GetZ(NPC)
  51. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,20))
  52. MovementLoopAddLocation(NPC, X + 6, Y + 2, Z - 3, 2, math.random(20,60))
  53. MovementLoopAddLocation(NPC, X - 4, Y + 3, Z - 8, 2, math.random(20,60))
  54. MovementLoopAddLocation(NPC, X - 7, Y - 9, Z + 2, 2, math.random(20,60))
  55. MovementLoopAddLocation(NPC, X + 9, Y - 8, Z + 10, 2, math.random(20,60))
  56. end
  57. function Route2(NPC)
  58. local X = GetX(NPC)
  59. local Y = GetY(NPC)
  60. local Z = GetZ(NPC)
  61. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,20))
  62. MovementLoopAddLocation(NPC, X - 6, Y - 2, Z + 3, 2, math.random(20,60))
  63. MovementLoopAddLocation(NPC, X + 4, Y - 5, Z + 8, 2, math.random(20,60))
  64. MovementLoopAddLocation(NPC, X + 7, Y + 3, Z - 2, 2, math.random(20,60))
  65. MovementLoopAddLocation(NPC, X - 9, Y + 3, Z - 10, 2, math.random(20,60))
  66. end
  67. function Route3(NPC)
  68. local X = GetX(NPC)
  69. local Y = GetY(NPC)
  70. local Z = GetZ(NPC)
  71. MovementLoopAddLocation(NPC, X, Y, Z, 2, math.random(5,20))
  72. MovementLoopAddLocation(NPC, X - 3, Y - 2, Z + 6, 2, math.random(20,60))
  73. MovementLoopAddLocation(NPC, X + 8, Y - 5, Z + 4, 2, math.random(20,60))
  74. MovementLoopAddLocation(NPC, X - 2, Y + 3, Z + 7, 2, math.random(20,60))
  75. MovementLoopAddLocation(NPC, X - 10, Y + 3, Z - 9, 2, math.random(20,60))
  76. end
  77. function Route4(NPC)
  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,20))
  82. MovementLoopAddLocation(NPC, X + 6, Y - 2, Z - 3, 2, math.random(20,60))
  83. MovementLoopAddLocation(NPC, X - 4, Y - 5, Z - 8, 2, math.random(20,60))
  84. MovementLoopAddLocation(NPC, X - 7, Y + 3, Z + 2, 2, math.random(20,60))
  85. MovementLoopAddLocation(NPC, X + 9, Y + 3, Z + 10, 2, math.random(20,60))
  86. end