9
3

aHaoaeranpoacher.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. --[[
  2. Script Name : <script-name>
  3. Script Purpose : <purpose>
  4. Script Author : <author-name>
  5. Script Date : <date>
  6. Script Notes : <special-instructions>
  7. --]]
  8. function spawn(NPC)
  9. choice = math.random(1, 4)
  10. if choice == 1 then
  11. clockwise1(NPC)
  12. elseif choice == 2 then
  13. clockwise2(NPC)
  14. elseif choice == 3 then
  15. counter_clockwise1(NPC)
  16. elseif choice == 4 then
  17. counter_clockwise2(NPC)
  18. end
  19. AddTimer(NPC, 10000, "InitialWait")
  20. end
  21. function respawn(NPC)
  22. spawn(NPC)
  23. end
  24. function InitialWait(NPC)
  25. AddTimer(NPC, 1000, "CheckForCrabs")
  26. end
  27. function CheckForCrabs(NPC)
  28. Crab = GetSpawn(NPC, 2630015)
  29. if GetDistance(NPC, Crab) <= 5 and IsAlive(Crab) then
  30. KillSpawn(Crab, NPC, 1)
  31. else
  32. Crab2 = GetSpawn(NPC, 2630016)
  33. if GetDistance(NPC, Crab2) <= 5 and IsAlive(Crab2) then
  34. KillSpawn(Crab2, NPC, 1)
  35. end
  36. end
  37. AddTimer(NPC, 10000, "SetUpCheck")
  38. end
  39. function SetUpCheck(NPC)
  40. AddTimer(NPC, 1000, "CheckForCrabs")
  41. end
  42. function aggro(NPC, Spawn)
  43. chance = math.random(1, 100)
  44. if chance <= 30 then
  45. PlayFlavor(NPC, "voiceover/english/rok_combat_vo/a_spiroc/ft/_exp04/aviak/spiroc_victory_9f0466af.mp3", "Score one for the spiroc!", "", 2170775157, 841438160)
  46. end
  47. end
  48. function killed(NPC, Spawn)
  49. chance = math.random(1, 100)
  50. if chance <= 30 then
  51. PlayFlavor(NPC, "voiceover/english/rok_combat_vo/a_spiroc/ft/_exp04/aviak/spiroc_aggro_64bf7f6f.mp3", "I'm taking this one down!", "", 1322142455, 2874795880)
  52. end
  53. end
  54. function clockwise1(NPC)
  55. x = GetX(NPC)
  56. y = GetY(NPC)
  57. z = GetZ(NPC)
  58. MovementLoopAddLocation(NPC, x + 7 , y, z - 8 , 2, math.random(5, 15))
  59. MovementLoopAddLocation(NPC, x - 5 , y, z - 10, 2, math.random(5, 15))
  60. MovementLoopAddLocation(NPC, x - 10, y, z + 9 , 2, math.random(5, 15))
  61. MovementLoopAddLocation(NPC, x + 5 , y, z + 8 , 2, math.random(5, 15))
  62. end
  63. function clockwise2(NPC)
  64. x = GetX(NPC)
  65. y = GetY(NPC)
  66. z = GetZ(NPC)
  67. MovementLoopAddLocation(NPC, x + 2 , y, z - 8 , 2, math.random(5, 15))
  68. MovementLoopAddLocation(NPC, x - 7 , y, z - 5 , 2, math.random(5, 15))
  69. MovementLoopAddLocation(NPC, x , y, z + 6 , 2, math.random(5, 15))
  70. MovementLoopAddLocation(NPC, x + 9 , y, z + 1 , 2, math.random(5, 15))
  71. end
  72. function counter_clockwise1(NPC)
  73. x = GetX(NPC)
  74. y = GetY(NPC)
  75. z = GetZ(NPC)
  76. MovementLoopAddLocation(NPC, x - 7 , y, z + 8 , 2, math.random(5, 15))
  77. MovementLoopAddLocation(NPC, x + 5 , y, z + 10, 2, math.random(5, 15))
  78. MovementLoopAddLocation(NPC, x + 10, y, z - 9 , 2, math.random(5, 15))
  79. MovementLoopAddLocation(NPC, x - 5 , y, z - 8 , 2, math.random(5, 15))
  80. end
  81. function counter_clockwise2(NPC)
  82. x = GetX(NPC)
  83. y = GetY(NPC)
  84. z = GetZ(NPC)
  85. MovementLoopAddLocation(NPC, x - 2 , y, z + 8 , 2, math.random(5, 15))
  86. MovementLoopAddLocation(NPC, x + 7 , y, z + 5 , 2, math.random(5, 15))
  87. MovementLoopAddLocation(NPC, x , y, z - 6 , 2, math.random(5, 15))
  88. MovementLoopAddLocation(NPC, x - 9 , y, z - 1 , 2, math.random(5, 15))
  89. end