circle_counterclockwise_small_02.lua 841 B

12345678910111213141516171819202122232425262728
  1. --[[
  2. Spawn Template
  3. Script Name : circle_counterclockwise_small_02.lua
  4. Script Purpose : Makes the spawn do a small circle in a counter-clockwise fashion.
  5. Script Author : Scatman
  6. Script Date : 2008-08-26
  7. Script Notes : If the coords are out of bounds then the spawn will still go there.
  8. These are just suggested functions to get you started. Edit as needed.
  9. --]]
  10. function spawn(NPC)
  11. x = GetX(NPC)
  12. y = GetY(NPC)
  13. z = GetZ(NPC)
  14. MovementLoopAddLocation(NPC, x - 2 , y, z + 8 , 2, math.random(5, 15))
  15. MovementLoopAddLocation(NPC, x + 7 , y, z + 5 , 2, math.random(5, 15))
  16. MovementLoopAddLocation(NPC, x , y, z - 6 , 2, math.random(5, 15))
  17. MovementLoopAddLocation(NPC, x - 9 , y, z - 1 , 2, math.random(5, 15))
  18. end
  19. function respawn(NPC)
  20. spawn(NPC)
  21. end
  22. function hailed(NPC, Spawn)
  23. FaceTarget(NPC, Spawn)
  24. end