aFreeportresident55820.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --[[
  2. Script Name : SpawnScripts/Freeport/aFreeportresident55820.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.03 07:05:24
  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, -160.59, -53.03, -275.92, 2)
  13. MoveToLocation(NPC, -175.75, -58.79, -223.07, 2)
  14. MoveToLocation(NPC, -189.17, -58.83, -212.58, 2)
  15. MoveToLocation(NPC, -193.15, -58.83, -204.21, 2)
  16. MoveToLocation(NPC, -188.02, -58.83, -201.04, 2, "heading")
  17. end
  18. function heading(NPC)
  19. SetHeading(NPC, 213.97)
  20. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  21. end
  22. function movement_loop_continue(NPC)
  23. MoveToLocation(NPC, -193.15, -58.83, -204.21, 2)
  24. MoveToLocation(NPC, -189.17, -58.83, -212.58, 2)
  25. MoveToLocation(NPC, -175.75, -58.79, -223.07, 2)
  26. MoveToLocation(NPC, -160.59, -53.03, -275.92, 2)
  27. MoveToLocation(NPC, -150.05, -52.84, -282.33, 2, "heading2")
  28. end
  29. function heading2(NPC)
  30. SetHeading(NPC, 110.79)
  31. AddTimer(NPC, 10000, "movement_loop_start", 1)
  32. end
  33. function hailed(NPC, Spawn)
  34. FaceTarget(NPC, Spawn)
  35. local choice = MakeRandomInt(1, 2)
  36. if choice == 1 then
  37. AddTimer(NPC, 10000, "movement_loop_start", 1)
  38. else
  39. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  40. end
  41. end
  42. function respawn(NPC)
  43. spawn(NPC)
  44. end