View Single Post
01-11-23, 03:47 AM   #1
Just_a_Lurker
A Kobold Labourer
Join Date: Jan 2023
Posts: 1
Weakaura code help

So I'm not the original creator of this Weakaura, I can't remember where it's from unfortunately so I can't contact the creator of it either. This currently attaches a Diminishing Return icon next to nameplates, it's exactly what I want. BUT this also applies to friendly nameplates. I want that feature removed, and make it so it's only attached to Enemy / Attackable nameplates.

This is the code inside Trigger -> Custom -> Trigger State Updater(Advanced) -> Event(s) -> COMBAT_LOG_EVENT_UNFILTERED, NAME_PLATE_UNIT_ADDED, NAME_PLATE_UNIT_REMOVED, PLAYER_REGEN_DISABLED, PLAYER_REGEN_ENABLED

Then this is inside the custom trigger there's this
"function(allstates, event, ...)
if event == 'PLAYER_REGEN_DISABLED' or event == 'PLAYER_REGEN_ENABLED' then
aura_env.clean_drs()
return false
end


if event == "NAME_PLATE_UNIT_ADDED" then
local np = select(1, ...)
return aura_env.track_plate(allstates, np)
end

if event == "NAME_PLATE_UNIT_REMOVED" then
local np = select(1, ...)
return aura_env.untrack_plate(allstates, np)
end

if event ~= 'COMBAT_LOG_EVENT_UNFILTERED' then
aura_env.debug('returning early from event ' .. event)
return

end
local sub_event = select(2, ...)


if sub_event == "UNIT_DIED" then
local dest_guid = select(8, ...)
return aura_env.untrack_guid(allstates, dest_guid)
end


if sub_event == 'SPELL_AURA_REMOVED' or sub_event == 'SPELL_AURA_REFRESH' then
return aura_env.check_aura(allstates, ...)
end




end




Is there anything in that code that can be changed to only apply to enemies?

Here's the entire Weakaura, might be easier - https://wago.io/VA0oXiTQ5
  Reply With Quote