Thread Tools Display Modes
Prev Previous Post   Next Post Next
04-09-13, 01:23 PM   #1
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
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
local name, _,_,_,_,_, expirationTime, fromwho = UnitAura(u, GetSpellInfo(126700) or "Surge of Victory")
    if(fromwho == "player") then
        local spellTimer = (expirationTime-GetTime())
		local TimeLeft = format("%.0f", spellTimer)
			return "|cfffaaaab"..TimeLeft.."|r"
    end
end
oUF.Tags.Events['GhostSoVTime'] = "UNIT_AURA"
When I'm using said code to track, let's say, Dancing Steel. It shows nothing.

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.

Code:
oUF.Tags.Methods['GhostDSTime'] = function(u) -- Dancing Steel Enchant Proc id 120032 or 118335
local name, _,_,_,_,_, expirationTime, fromwho = UnitAura(u, GetSpellInfo(120032) or "Dancing Steel")
    if (name == "Dancing Steel") then
        local spellTimer = (expirationTime-GetTime())
		local TimeLeft = format("%.0f", spellTimer)
			return "|cff6670FF"..TimeLeft.."|r"
    end
end
oUF.Tags.Events['GhostDSTime'] = "UNIT_AURA"
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."


Last edited by Dawn : 04-09-13 at 01:30 PM.
  Reply With Quote
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » how to track a weapon enchant proc with a tag


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off