Working with Weakauras and a custom trigger function that works so far to display a texture on my current target’s nameplate. The texture is also based on a usable action. Once I employ this function I can no longer use the normal Weakauras interface to create a second trigger condition. This is the LUA that does this successfully
function()
local region = aura_env.region
local plate = C_NamePlate.GetNamePlateForUnit(“target”)
local start, duration, enabled = GetSpellCooldown(“Shield Block”)
if plate then
region:ClearAllPoints()
region:SetPoint(“CENTER”, plate, “CENTER”, 0, 24)
if duration == 0 then
region:Show()
else
region:Hide()
end
else
region:Hide()
end
return true
end
What I am trying to do but am, so far, unable to figure out is to create a similar texture for a debuff on the target. I’ve tried a few API functions but can’t seem to get the following LUA to work.
function()
local region = aura_env.region
local plate = C_NamePlate.GetNamePlateForUnit(“target”)
local db = AuraUtil.FindAuraByName(“Demoralizing Shout”, “target”)
if plate then
region:ClearAllPoints()
region:SetPoint(“CENTER”, plate, “CENTER”, 0, 24)
if db then
region:Hide()
else
region:Show()
end
else
region:Hide()
end
return true
end
The game shows the texture on my targeted nameplate but the texture does not go away when I cast Demoralizing Shout…Can anyone tell me what I’m doing incorrectly?