aHaoaeranpoacher.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. --[[
  2. Script Name : SpawnScripts/TimorousDeep/aHaoaeranpoacher.lua
  3. Script Purpose : a Haoaeran poacher spawn script
  4. Script Author : premierio015
  5. Script Date : 03.04.2023
  6. Script Notes :
  7. --]]
  8. local crablist = { 35182, 34566, 34575, 34752, 34873, 35006, 35182, 35355, 35470, 35506, 35527, 35535, 35544, 35550, 35551, 35554, 35555, 35581, 35635, 35698, 35768, 35818, 35848, 35867, 35889, 35918, 35943, 35948, 35951, 35960, 35971, 35981 }; -- array with crabs location ID's
  9. function prespawn(NPC)
  10. for k, v in ipairs(crablist) do
  11. AddSpawnProximity(NPC, v, 1, 5, "InRange")
  12. end
  13. end
  14. function spawn(NPC)
  15. choice = math.random(1, 4)
  16. if choice == 1 then
  17. clockwise1(NPC)
  18. elseif choice == 2 then
  19. clockwise2(NPC)
  20. elseif choice == 3 then
  21. counter_clockwise1(NPC)
  22. elseif choice == 4 then
  23. counter_clockwise2(NPC)
  24. end
  25. end
  26. function respawn(NPC)
  27. spawn(NPC)
  28. end
  29. function InRange(NPC)
  30. local crab = GetSpawn(NPC, 2630018)
  31. if crab ~= nil then
  32. Attack(NPC, crab)
  33. end
  34. end
  35. function killed(NPC, Spawn)
  36. chance = MakeRandomInt(1, 100)
  37. if chance <= 50 then
  38. PlayFlavor(NPC, "voiceover/english/rok_combat_vo/a_spiroc/ft/_exp04/aviak/spiroc_victory_9f0466af.mp3", "Score one for the spiroc!", "", 2170775157, 841438160)
  39. end
  40. end
  41. function aggro(NPC, Spawn)
  42. chance = MakeRandomInt(1, 100)
  43. if chance <= 50 then
  44. option = MakeRandomInt(1, 2)
  45. if option == 1 then
  46. PlayFlavor(NPC, "voiceover/english/rok_combat_vo/a_spiroc/ft/_exp04/aviak/spiroc_aggro_64bf7f6f.mp3", "I'm taking this one down!", "", 1322142455, 2874795880)
  47. else
  48. PlayFlavor(NPC, "voiceover/english/rok_combat_vo/a_spiroc/ft/_exp04/aviak/spiroc_aggro_ef272489.mp3", "Hostile at twelve o'clock!", "", 1038256671, 3948487543)
  49. end
  50. end
  51. end
  52. function clockwise1(NPC)
  53. x = GetX(NPC)
  54. y = GetY(NPC)
  55. z = GetZ(NPC)
  56. MovementLoopAddLocation(NPC, x + 7 , y, z - 8 , 2, math.random(5, 15))
  57. MovementLoopAddLocation(NPC, x - 5 , y, z - 10, 2, math.random(5, 15))
  58. MovementLoopAddLocation(NPC, x - 10, y, z + 9 , 2, math.random(5, 15))
  59. MovementLoopAddLocation(NPC, x + 5 , y, z + 8 , 2, math.random(5, 15))
  60. end
  61. function clockwise2(NPC)
  62. x = GetX(NPC)
  63. y = GetY(NPC)
  64. z = GetZ(NPC)
  65. MovementLoopAddLocation(NPC, x + 2 , y, z - 8 , 2, math.random(5, 15))
  66. MovementLoopAddLocation(NPC, x - 7 , y, z - 5 , 2, math.random(5, 15))
  67. MovementLoopAddLocation(NPC, x , y, z + 6 , 2, math.random(5, 15))
  68. MovementLoopAddLocation(NPC, x + 9 , y, z + 1 , 2, math.random(5, 15))
  69. end
  70. function counter_clockwise1(NPC)
  71. x = GetX(NPC)
  72. y = GetY(NPC)
  73. z = GetZ(NPC)
  74. MovementLoopAddLocation(NPC, x - 7 , y, z + 8 , 2, math.random(5, 15))
  75. MovementLoopAddLocation(NPC, x + 5 , y, z + 10, 2, math.random(5, 15))
  76. MovementLoopAddLocation(NPC, x + 10, y, z - 9 , 2, math.random(5, 15))
  77. MovementLoopAddLocation(NPC, x - 5 , y, z - 8 , 2, math.random(5, 15))
  78. end
  79. function counter_clockwise2(NPC)
  80. x = GetX(NPC)
  81. y = GetY(NPC)
  82. z = GetZ(NPC)
  83. MovementLoopAddLocation(NPC, x - 2 , y, z + 8 , 2, math.random(5, 15))
  84. MovementLoopAddLocation(NPC, x + 7 , y, z + 5 , 2, math.random(5, 15))
  85. MovementLoopAddLocation(NPC, x , y, z - 6 , 2, math.random(5, 15))
  86. MovementLoopAddLocation(NPC, x - 9 , y, z - 1 , 2, math.random(5, 15))
  87. end