acliffdiverhawk.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/acliffdiverhawk.lua
  3. Script Author : Cynnar
  4. Script Date : 2018.12.24 12:12:43
  5. Script Purpose :
  6. Script Notes : Hawk needs to turn around after the return flight to original location
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function respawn(NPC)
  11. spawn(NPC)
  12. end
  13. function hailed(NPC, Spawn)
  14. end
  15. function FlyToMoleRat(NPC)
  16. local TargetMoleRat = GetTempVariable(NPC, "MoleRat")
  17. if TargetMoleRat ~= nil then
  18. local x = GetX(TargetMoleRat)
  19. local y = GetY(TargetMoleRat)
  20. local z = GetZ(TargetMoleRat)
  21. MoveToLocation(NPC, x, y, z, 8, "KillMoleRat")
  22. end
  23. end
  24. function KillMoleRat(NPC)
  25. local MoleRat = GetTempVariable(NPC, "MoleRat")
  26. if MoleRat ~= nil then
  27. SetTempVariable(NPC, "MoleRat", nil)
  28. Despawn(MoleRat)
  29. AddTimer(NPC, 2500, "ReturnHome")
  30. end
  31. end
  32. function ReturnHome(NPC)
  33. local x = GetOrigX(NPC)
  34. local y = GetORigY(NPC)
  35. local z = GetOrigZ(NPC)
  36. if IsInCombat(NPC) == false then
  37. MoveToLocation(NPC, x, y, z, 5)
  38. end
  39. end