9
3

Rothach.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : SpawnScripts/Freeport/Rothach.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.07.19 10:07:05
  5. Script Purpose :
  6. :
  7. --]]
  8. dofile("SpawnScripts/Generic/GenericGuardVoiceOvers.lua")
  9. function spawn(NPC)
  10. AddTimer(NPC, 900, "followguard", 1)
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. GenericGuardHail(NPC, Spawn, Faction)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function followguard(NPC, Spawn)
  20. local zone = GetZone(NPC)
  21. local GUARD_LEADER = GetSpawnByLocationID(zone, 56131)
  22. if GUARD_LEADER ~= nil then
  23. local leaderX = GetX(GUARD_LEADER)
  24. local leaderY = GetY(GUARD_LEADER)
  25. local leaderZ = GetZ(GUARD_LEADER)
  26. local speed = 2
  27. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. ", " .. GetY(guard_A_placement) .. ", " .. GetZ(guard_A_placement))
  28. if GetDistance(NPC, GUARD_LEADER) >= 8 then
  29. speed = 5
  30. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  31. else
  32. speed = 2
  33. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ, speed)
  34. end
  35. AddTimer(NPC, 3000, "followguard")
  36. end
  37. end