9
3

anAntonicanhawk.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/anAntonicanhawk.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.02.26 04:02:53
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. ChoosePath(NPC)
  10. end
  11. function hailed(NPC, Spawn)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function ChoosePath(NPC)
  17. local route = math.random(1,2)
  18. if route == 1 then
  19. RouteOne(NPC, Spawn)
  20. elseif route == 2 then
  21. RouteTwo(NPC, Spawn)
  22. end
  23. end
  24. function RouteOne(NPC, Spawn)
  25. x = GetX(NPC)
  26. y = GetY(NPC)
  27. z = GetZ(NPC)
  28. MovementLoopAddLocation(NPC, x - 7 , 0, z + 8 , 2, math.random(5, 45))
  29. MovementLoopAddLocation(NPC, x + 5 , 0, z + 10, 2, math.random(5, 45))
  30. MovementLoopAddLocation(NPC, x + 10, 0, z - 9 , 2, math.random(5, 45))
  31. MovementLoopAddLocation(NPC, x - 5 , 0, z - 8 , 2, math.random(5, 45))
  32. end
  33. function RouteTwo(NPC, Spawn)
  34. local X = GetX(NPC)
  35. local Y = GetY(NPC)
  36. local Z = GetZ(NPC)
  37. MovementLoopAddLocation(NPC, x - 5 , 0, z - 8 , 2, math.random(5, 45))
  38. MovementLoopAddLocation(NPC, x + 10, 0, z - 9 , 2, math.random(5, 45))
  39. MovementLoopAddLocation(NPC, x + 5 , 0, z + 10, 2, math.random(5, 45))
  40. MovementLoopAddLocation(NPC, x - 7 , 0, z + 8 , 2, math.random(5, 45))
  41. end