#How to filter a trigger for a neutral unit
25 messages · Page 1 of 1 (latest)
you'd need a custom trigger that uses https://warcraft.wiki.gg/wiki/API_UnitReaction .
example: custom - status - events - PLAYER_TARGET_CHANGED in events
custom trigger:
function()
return UnitReaction("player","target") == 4
end
There is a unit reaction in Player/Unit Info I think
there's no default trigger atm for checking neutral mobs
You can use two default triggers with a custom activation.
!WA:2!DvvZoUrrq44yKI0iaL1XjIa5GjarqoeXUHeYgqi5XXoXih7LXEzdcfz3Zm94UZoU7HU7X)KBXxyp7lCJd(mN8JW(e0YING9apa7tav3ZyVjXwYURQRQ6QQ(7R6cnknQuyPWt(6L0aoRlpveGV1Let7efjXQcRqHVkvQWHphn9YxiqzxwmBRjSacxCaNYu(1Q3UxDV1bCECiFcR7eAcEWPBeRhoetCnh0G5kbD4qSq(33rKV8KRTovI7t4sfnMQMroZiI8LCH)Z5H4b2TdiibkqHfepgAew6KzLsHcog5hJhSme7Ngf1Bwcw8S6ToOXHTCvGGBkJQwymogpghtotM6dlyQUG10PR6xRA3E972RQxppR(KYhcEuP2MdKc5vGCUjcMqnWglwsqZWlI1bcmelVUhuVvR5YeCCCZqPJ(6(kKyiwLu6Is6zyuSTSs2XOuGOqtwCCtwiEkzX2UW8ibfZcJNDwqmskPr0aKIYzolsz5noN7O)WtUMGYgk4Pjo6pAG(JhO)c9xAZqRBeDjDw7100eWrpIOVnr)5deyPeZcWf03u)P6Br0L1xh(wjlRgIzqHh0LWN0HLNPMiKeJuytlEWAktQaiaUVK(ASJ(ZYUMIGwgKLnFYa9DCwfsLVkLbAgJ9daieFusPS)7LvcT4dPbj3nYAeNv5RvFJtfbwLkyvu)(UVScIfwHXvGWEV0b6hj7GSHl3FtJ8FU05aeelyO4Ffawqy(RZpgJtQc3dbkptxJSaXOJS9Vh6bPTq14umsI7Qey2qf5k6YUmodVomvyTQVb5iKyaYgkNBm1u069DhHOSg6hboO3x)y9pO)r9((rugvsEF1aGuIuMaIjlbGIhEiez5JVHU8Aq0haUMlow4jLtkPWtv9LeeqxErobl5MwL2FI4ci97lZxO3FX29U9xjtU6B5EnEmx8ZfkuO4zzAXXrwsQB1d71j5AwLOu4oaQ0GJOHkIBvq88SdIofhAv(M1ze8FlpDo1UVzqanAM(klfCLblakDB3PDDDzbuugBwAnmWMgfHplYRaGzD1gc6RR8lPOqORGQ0R37u4BoP1wDt4IWJeOK5hLVilbgtLudDpVMFRHqj70SD76E9D70RxNN718PpR36ThDxaKEZ8k6fVZ5y21o0OZH9A1SD9)B9Wy(Kgc8FKc8Jzh8bF7927bzvNzJtn)8KCysX5gjJ3R9tvkoRZySignBPrDll066RmR3uAlmc122AofOmpDJgI1YTjNnYeAWXmGPw06y3aumUORzjXQOff2Ch7P5cDjy4OpbthsuVXnMJcBaJFIHPt3WBuASI64Aye3qZD8SdhmRCnSxZIKRc5s18b925(K3xfLrwkSGylzWXdfNqqf3lLgUACd0939rTQE)PhTIYYqPMPvNLi4dnZAYEI5U36sxwKnIq(q937O)jhxG8OCCFnNpQG3fOMLkEW4m68Nu4p53MgUxB8KvrcykeqBb4tr7u1A5VXatcaQoEG3el498SR6ggZnzRF3AE1R32hi0r0HoWqttWXKKYBEKYGKFcvAEljKSgiiG7DsSzQZsZCaA265BCyWITul9vkj9FW9297U3ULg)VV4))
this acticates on neutral and enemy targets
i think this might only work with units that have reputations. i tried it on some random critter / animal and it didnt work
!WA:2!DvvZUTTrqy7OI2cDkw1XabifqXaTOPOiTjijfPaPbIYu2krwYLIoobXasl5Uu7gtTl7UlTLClkA0PCQh0LEQx05Espc(jGqOpb(qV0B(jOZUKY5hEGy2zMDM5B(BxTrLHvWvWV5BNXcf8UIuzi5gR4fkIfYNuANh)FV8L)(kRSYopEwLkvbIsZr4xLQ0e8Um(vKJ7efPi6vNJ4HuHCpbJRdQ72231BrOqeJfNW7EclH0)SLhDXdiuhJ36prlzdgqKQ)4lLfKVzJfPkspQqPzXm9y65MJOaLqgSRat6BfhsrsuOMiPNRsdiht469KKi2iVU752Qv(D0Au4rO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Bu5SFRSdOKUCY6lFSW0)Vftz2IJPzYKh00SVicfsoSgg3HRo8ac6OAqaPoCxcMHo0phYQdRZKHXKEhqzAYDtz45728UrB9uj7jVASZPcXWvNhjHhbaSbdlLMPfHhNVe6t)RSnzyV2KtQ(9xK3t3WOPbDbDR75622dfNqrL8oXokBF1OEridzwyZfPFaKwIydklzCJDj0fWwbWuDsSaUSCurR4mt(JLZCYsG3)8ePyaGdv(BYF9nw5kvub3)235E3(ovo(FE()p
this is just a proxy graphic. it should show the yellow circle when i target an neutral npc
the goal is to recolor a certain graphical asset on my target unitframe, when its a neutral npc to make to color fit. like this:
code's in the wrong place, should be there & change "Required for Activation" back to trigger 1
I didn't do extensive testing, but there were certain NPCs that were considered neutral that both Kolmar and My solution did not trigger.
okay, no worries. after putting the code in the right spot it worked on the critter but not on random npc but that is okay. mostly wanted it for mobs in the wild

which npc didn't it work on? just out of curiosity
One in orgrimmar ongrimmar
him for example
in dalaran
seems like any of the "friendly" neutral mobs it doesn't trigger on
but that might not be true
huh true, that NPC is tagged as hostile even though she's yellow (on my ally char).
https://warcraft.wiki.gg/wiki/API_UnitSelectionColor that seems to work better, though more annoying to use.
function()
local r,g,b = UnitSelectionColor("target")
return r == 1 and g == 1 and b == 0
end