aMilitiacommander.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/Freeport/aMilitiacommander.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.04.25 10:04:54
  5. Script Purpose :
  6. Scripts Notes : need to add animations
  7. --]]
  8. function spawn(NPC)
  9. movement_loop_start(NPC) -- we start here
  10. end
  11. function hailed(NPC, Spawn)
  12. FaceTarget(NPC, Spawn)
  13. AddTimer(NPC, 3000, "movement_loop_continue", 1, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function movement_loop_start(NPC)
  19. MoveToLocation(NPC, 90.35, -10.01, -42.31, 2)
  20. MoveToLocation(NPC, 89.77, -10.03, -47.38, 2, "stay_and_return")
  21. end
  22. function stay_and_return(NPC) -- Changes Commander heading and pause for 10 sec.
  23. SetHeading(NPC, 351.54)
  24. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  25. end
  26. function movement_loop_continue(NPC, Spawn) -- Continues his movement to next waypoints
  27. MoveToLocation(NPC, 90.35, -10.01, -42.31, 2)
  28. MoveToLocation(NPC, 74.26, -9.76, -30.43, 2, "stay_and_return2")
  29. end
  30. function stay_and_return2(NPC)
  31. SetHeading(NPC, 112.90)
  32. AddTimer(NPC, 10000, "movement_loop_start", 1) -- last timer to make a Loop
  33. end