aBlackfurlswabbieBeach.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/aBlackfurlswabbieBeach.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.02.26 03:02:38
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. ChooseMovement(NPC)
  10. end
  11. function hailed(NPC, Spawn)
  12. FaceTarget(NPC, Spawn)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function ChooseMovement(NPC)
  18. -- if GetSpawnLocationID(NPC)== 133772824 or 133772825 or 133772826 then
  19. local choice = math.random(1, 4)
  20. if choice == 1 then
  21. clockwise1(NPC)
  22. elseif choice == 2 then
  23. clockwise2(NPC)
  24. elseif choice == 3 then
  25. counter_clockwise1(NPC)
  26. elseif choice == 4 then
  27. counter_clockwise2(NPC)
  28. end
  29. ---else
  30. --end
  31. end
  32. function respawn(NPC)
  33. spawn(NPC)
  34. end
  35. function clockwise1(NPC)
  36. local x = GetX(NPC)
  37. local y = GetY(NPC)
  38. local z = GetZ(NPC)
  39. MovementLoopAddLocation(NPC, x + 1.5 , y, z - 2 , 2, math.random(2, 9))
  40. MovementLoopAddLocation(NPC, x - .5 , y, z - 3, 2, math.random(2, 9))
  41. MovementLoopAddLocation(NPC, x - 3, y, z + 2.5 , 2, math.random(2, 9))
  42. MovementLoopAddLocation(NPC, x , y, z , 0 , math.random(5, 9))
  43. MovementLoopAddLocation(NPC, x + .5 , y, z + 2 , 2, math.random(2, 9))
  44. end
  45. function clockwise2(NPC)
  46. local x = GetX(NPC)
  47. local y = GetY(NPC)
  48. local z = GetZ(NPC)
  49. MovementLoopAddLocation(NPC, x + 1 , y, z - 2 , 2, math.random(2, 9))
  50. MovementLoopAddLocation(NPC, x - 3.5 , y, z - .5 , 2, math.random(2, 9))
  51. MovementLoopAddLocation(NPC, x , y, z + 1 , 2, math.random(2, 9))
  52. MovementLoopAddLocation(NPC, x , y, z , 0 , math.random(5, 15),"Action")
  53. MovementLoopAddLocation(NPC, x + 2.5 , y, z + .5 , 2, math.random(2, 9))
  54. end
  55. function counter_clockwise1(NPC)
  56. local x = GetX(NPC)
  57. local y = GetY(NPC)
  58. local z = GetZ(NPC)
  59. MovementLoopAddLocation(NPC, x - 1.5 , y, z + 1 , 2, math.random(2, 15),"Action")
  60. MovementLoopAddLocation(NPC, x , y, z , 0 , math.random(5, 9))
  61. MovementLoopAddLocation(NPC, x + .5 , y, z + 3, 2, math.random(2, 9))
  62. MovementLoopAddLocation(NPC, x + 2, y, z - 2.5 , 2, math.random(2, 10))
  63. MovementLoopAddLocation(NPC, x - .5 , y, z - 2 , 2, math.random(2, 10))
  64. end
  65. function counter_clockwise2(NPC)
  66. local x = GetX(NPC)
  67. local y = GetY(NPC)
  68. local z = GetZ(NPC)
  69. MovementLoopAddLocation(NPC, x - 1 , y, z + 2 , 2, math.random(2, 10))
  70. MovementLoopAddLocation(NPC, x + 1.5 , y, z + .5 , 2, math.random(2, 9))
  71. MovementLoopAddLocation(NPC, x , y, z - 1 , 2, math.random(2, 15),"Action")
  72. MovementLoopAddLocation(NPC, x , y, z , 0 ,2, math.random(5, 10))
  73. MovementLoopAddLocation(NPC, x - 2.5 , y, z - .5 , 2, math.random(2, 10))
  74. end