9
3

aMilitiaguard55534.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --[[
  2. Script Name : SpawnScripts/Freeport/aMilitiaguard55534.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.03 09:05:56
  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, -194.12, -55.93, -97.84, 2)
  13. MoveToLocation(NPC, -201.06, -56.07, -31.39, 2)
  14. MoveToLocation(NPC, -157.47, -52.59, -21.55, 2, "heading")
  15. end
  16. function heading(NPC)
  17. SetHeading(NPC, 281.97)
  18. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  19. end
  20. function movement_loop_continue(NPC)
  21. MoveToLocation(NPC, -201.06, -56.07, -31.39, 2)
  22. MoveToLocation(NPC, -194.12, -55.93, -97.84, 2)
  23. MoveToLocation(NPC, -187.80, -56.43, -107.13, 2)
  24. MoveToLocation(NPC, -206.31, -58.87, -114.96, 2, "heading2")
  25. end
  26. function heading2(NPC)
  27. SetHeading(NPC, 71.44)
  28. AddTimer(NPC, 10000, "movement_loop_start", 1)
  29. end
  30. function hailed(NPC, Spawn)
  31. FaceTarget(NPC, Spawn)
  32. local choice = MakeRandomInt(1, 2)
  33. if choice == 1 then
  34. AddTimer(NPC, 10000, "movement_loop_start", 1)
  35. else
  36. AddTimer(NPC, 10000, "movement_loop_continue", 1)
  37. end
  38. local speech_choice = math.random(1, 3)
  39. if speech_choice == 1 then
  40. PlayFlavor(NPC, "", "Do not challenge my authority, citizen. In Freeport, the Overlord's word is law!", "scold", 1689589577, 4560189, Spawn)
  41. elseif speech_choice == 2 then
  42. PlayFlavor(NPC, "", "The Overlord commands me to patrol this area, and so I must.", "tapfoot", 1689589577, 4560189, Spawn)
  43. else
  44. PlayFlavor(NPC, "", "Do you have business with the Freeport Militia?", "glare", 1689589577, 4560189, Spawn)
  45. end
  46. end
  47. function respawn(NPC)
  48. spawn(NPC)
  49. end