Skip to content

Instantly share code, notes, and snippets.

@StinkyTwitch
Last active August 29, 2015 14:08
Show Gist options
  • Save StinkyTwitch/90ae679cbcb1046acdf4 to your computer and use it in GitHub Desktop.
Save StinkyTwitch/90ae679cbcb1046acdf4 to your computer and use it in GitHub Desktop.
Hunter Library - Pet To Target Distance
local libPST = {}
--[[------------------------------------------------------------------------------------------------
DISTANCE BETWEEN PET AND TARGET
--------------------------------------------------------------------------------------------------]]
function libPST.PetToTargetDistance(check)
local x1, y1, z1 = ObjectPosition("Pet")
local x2, y2, z2 = ObjectPosition("Target")
local dx = x2 - x1
local dy = y2 - y1
local dz = z2 - z1
distance = math.sqrt((dx*dx) + (dy*dy) + (dz*dz))
if distance > check then
return true
else
return false
end
end
ProbablyEngine.library.register('libPST', libPST)
-- Rotation Code
{"/cast Dash", {"@libPST.PetToTargetDistance(15)", "timeout(petDash, 2)"}},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment