9
3

VariniusDrusus.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. Script Name : SpawnScripts/Freeport/VariniusDrusus.lua
  3. Script Author : Premierio015
  4. Script Date : 2020.07.19 11: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 followguard(NPC, Spawn)
  17. local zone = GetZone(NPC)
  18. local GUARD_LEADER = GetSpawnByLocationID(zone, 56258)
  19. if GUARD_LEADER ~= nil then
  20. local leaderX = GetX(GUARD_LEADER)
  21. local leaderY = GetY(GUARD_LEADER)
  22. local leaderZ = GetZ(GUARD_LEADER)
  23. local speed = 2
  24. -- Say(NPC, "Leader location is: " .. GetX(guard_A_placement) .. ", " .. GetY(guard_A_placement) .. ", " .. GetZ(guard_A_placement))
  25. if GetDistance(NPC, GUARD_LEADER) >= 8 then
  26. speed = 2
  27. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ -2, speed)
  28. else
  29. speed = 2
  30. MoveToLocation(NPC, leaderX - 2, leaderY, leaderZ -2, speed)
  31. end
  32. AddTimer(NPC, 3000, "followguard")
  33. end
  34. end
  35. function respawn(NPC)
  36. spawn(NPC)
  37. end