Bastion aims to serve as a highly performant, simplisitic, and expandable World of Warcraft data visualization framework.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bastion/scripts/shared/draw-rop.lua

45 lines
979 B

local
Tinkr,
---@type Bastion
Bastion = ...
local Player = Bastion.UnitManager:Get('player')
local RuneOfPower = Bastion.SpellBook:GetSpell(116011)
local Draw = Tinkr.Util.Draw:New()
Draw:Sync(function(draw)
for i, object in ipairs(Objects()) do
local name = ObjectName(object)
if name == RuneOfPower:GetName() then
local creator = ObjectCreator(object)
if tostring(creator) == tostring(Player:GetGUID()) then
local distance = ObjectDistance('player', object)
local ropX, ropY, ropZ = ObjectPosition(object)
draw:Circle(ropX, ropY, ropZ, 8)
draw:SetColor(69, 7, 58)
if distance > 8 then
draw:SetColor(252, 3, 207)
end
end
end
end
end)
local isEnabled = false
-- Draws a circle around the players Rune of Power to make it easier to stay within range.
local function EnableDrawROP()
if not isEnabled then
isEnabled = true
Draw:Enable()
end
end
return EnableDrawROP