#Help with Creature Type trigger

5 messages · Page 1 of 1 (latest)

winged cloak
#

Hello, I am trying to create a WeakAura for my Rogue where if I have a hostile, 'out of combat' unit targeted, whether it be NPC or player, WeakAuras will display a 'Sap' icon near the targets Unit Frame. The only issue I have come across is being able to filter the Creature Type on my target. I am unable to find anything that works for that in Trigger>Player/Unit Info>Unit Characteristics, or any other dropdown option. I am guessing that I need to create a Custom Trigger for this. Could anybody help me out with that? Thanks much!

(Note: the only units I am able to Sap are Humanoids, Beasts, Demons, and Dragonkin. So I need to filter for those.)

candid solstice
#

Something like this as a custom trigger running on the event PLAYER_TARGET_CHANGED should work:

function(event)
    local targettype = UnitCreatureType("target")
    local alive = not UnitIsDead("target")
    local sappable = targettype == "Humanoid" or targettype == "Beast" or targettype == "Dragonkin" or targettype == "Demon"
    return sappable and alive
end```
That will check that the target is both alive and one of the mentioned creature types. You would still want a second trigger that checks if the target is hostile and out of combat. Then require both triggers to activate the aura.

For anchoring it you'd change the anchor in the Display tab to anchor to `TargetFrame` then mess around with the postioning and offsets until you have it where you want.
#

You'll also need to manually set the Display icon to the Sap icon. By default it will try to use dynamic information that isn't there.

mossy fractal
#

You could just use a simple Spell Usable Trigger for this

candid solstice
#

I thought invalid enemy types just immuned sap, but it was still usable against them. I might be outdated on that though.