aFreeportdweller56774.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --[[
  2. Script Name : SpawnScripts/Freeport/aFreeportdweller56774.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.03 08:05:00
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. movement_loop_start(NPC)
  10. end
  11. function movement_loop_start(NPC)
  12. MoveToLocation(NPC, -272.91, -56.07, -79.72, 2)
  13. MoveToLocation(NPC, -211.88, -56.07, -81.25, 2)
  14. MoveToLocation(NPC, -211.68, -56.07, -82.88, 2, "heading")
  15. end
  16. function heading(NPC)
  17. SetHeading(NPC, 359.44)
  18. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  19. end
  20. function heading2(NPC)
  21. SetHeading(NPC, 174.88)
  22. AddTimer(NPC, 7000, "movement_loop_start")
  23. end
  24. function movement_loop_continue(NPC)
  25. MovementLoopAddLocation(NPC, -211.88, -56.07, -81.25, 2, 0)
  26. MovementLoopAddLocation(NPC, -272.91, -56.07, -79.72, 2, 0)
  27. MovementLoopAddLocation(NPC, -276.83, -55.5, -72, 2, 0, "heading2")
  28. end
  29. function hailed(NPC, Spawn)
  30. FaceTarget(NPC, Spawn)
  31. local choice = MakeRandomInt(1, 2)
  32. if choice == 1 then
  33. AddTimer(NPC, 10000, "movement_loop_start", 1)
  34. else
  35. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  36. end
  37. end
  38. function respawn(NPC)
  39. spawn(NPC)
  40. end