how to track a weapon enchant proc with a tag
As the title suggest I'm trying to track weapon enchant procs (like Dancing Steel, Colossus, ...) with a tag.
I'm using this code to track all kinds of other "normal" buffs. for instance, this one tracks the PvP strength trinket proc. The same code also works for things like Sacred Shield, Renew, ... Code:
oUF.Tags.Methods['GhostSoVTime'] = function(u) -- PvP Trinket Strength Proc I suppose it's because "fromwho" fails to return anything for weapon enchant procs? Since the "casterID" (aka fromwho) can only be player, but even if I use "if fromwho == "none"" or just "if fromwho then". It still returns nothing. So how do I have to adapt the code to track weapon enchant procs? :) Edit: Found a way ... just checking for the name instead of owner. :rolleyes: Code:
oUF.Tags.Methods['GhostDSTime'] = function(u) -- Dancing Steel Enchant Proc id 120032 or 118335 |
You should avoid doing a GetSpellInfo lookup on every UNIT_AURA event. You can also avoid the cost of the string concatenation by including the color codes directly in your format pattern.
Code:
local DANCING_STEEL = GetSpellInfo(120032) |
Problem was, if I didn't check for casterID (fromwho), I kept getting an error on "expirationTime".
I'll try the code, will stick with your formatting, it's cleaner. Thanks. :) E: Works nicely, thanks again Phanx. |
It's usually best to just check the most directly related thing -- in this case, the data you actually want to work with is the expiration time, so just check if that has a value. If it does, you're good to go. Checking other things like the buff name or caster unit may work, but is really just superfluous and doesn't necessarily guarantee that the data you want is there.
It's similar to browser sniffing vs. feature detection in JavaScript, if you do any web development -- you should always just check to see if the feature you want to use exists, instead of trying to figure out which version of which browser is running your code and make assumptions about which features that version of that browser supports. Unfortunately, a lot of sites use browser sniffing, which leads to the endless "site X doesn't work in browser Y" problems. |
All times are GMT -6. The time now is 08:53 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI