Thread Tools Display Modes
10-18-08, 04:52 PM   #1
blackpandemic
A Flamescale Wyrmkin
 
blackpandemic's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jan 2008
Posts: 123
oUF Perfect - Adding Other Debuff Types

Hey modders!

Let me start by saying thanks to anyone who develops mods and updated so quickly with the 3.0 change!

My question is, I've started using oUF as it's the best unit frame mod on the market IMO and I've started using p3lim's template as well as his oUF_Perfect (http://www.wowinterface.com/download...UFPerfect.html).

Included are small text overlays which tell when the raid/party member is poisoned/cursed (as p3lim plays a druid) but I would also like to add magic debuffs (and perhaps stuns).

The lines of code where these are located is:
oUF.Tags['[inner]'] = function(u) return UnitAura(u, 'Innervate') and '|cff00ff33Inn|r' or '' end
oUF.Tags['[afk]'] = function(u) return UnitIsAFK(u) and '<AFK>' or '' end

local function HasDType(unit, t)
for i=1,40 do
local name,_,_,_,dtype = UnitDebuff(unit, i)
if(name and dtype == t) then return true end
return false
end
end

oUF.Tags['[curse]'] = function(u) return HasDType(u, 'Curse') and '|cff9900ffCu|r ' or '' end
oUF.Tags['[poison]'] = function(u) return HasDType(u, 'Poison') and '|cff009900Po|r ' or '' end

oUF.TagEvents['[smarthp]'] = 'UNIT_HEALTH'
oUF.TagEvents['[smartpp]'] = 'UNIT_POWER UNIT_DISPLAYPOWER'
oUF.TagEvents['[inner]'] = 'UNIT_AURA'
oUF.TagEvents['[afk]'] = 'PLAYER_FLAGS_CHANGED'

oUF.TagEvents['[curse]'] = 'UNIT_AURA'
oUF.TagEvents['[poison]'] = 'UNIT_AURA'

My question is do I just add lines that say:
oUF.Tags['[magic]'] = function(u) return HasDType(u, 'Magic') and '<color> ' or '' end
oUF.TagEvents['[magic]'] = 'UNIT_AURA'


Last time I tried to edit LUA like this (beyond positioning, text, and textures) I broke the addon, so just wanted to run this idea by the people who actually know what to do before breaking anything else
__________________
"It is forbidden to kill; therefore all murderers are punished unless they kill in large numbers and to the sound of trumpets." -Voltaire
  Reply With Quote
10-18-08, 05:02 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
It should work, but test before asking
  Reply With Quote
10-18-08, 05:32 PM   #3
blackpandemic
A Flamescale Wyrmkin
 
blackpandemic's Avatar
AddOn Compiler - Click to view compilations
Join Date: Jan 2008
Posts: 123
Haven't found a willing soul to group with me to test, but as a more general LUA question, what will prevent it from showing my Mg tag when people are buffed, as aren't those magic?

Is there something in that code that will limit it to magic debuffs?

EDIT: Restarted my coding, will edit again when I can get a magic debuff.
__________________
"It is forbidden to kill; therefore all murderers are punished unless they kill in large numbers and to the sound of trumpets." -Voltaire

Last edited by blackpandemic : 10-18-08 at 05:41 PM.
  Reply With Quote
10-19-08, 06:41 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by blackpandemic View Post
Haven't found a willing soul to group with me to test, but as a more general LUA question, what will prevent it from showing my Mg tag when people are buffed, as aren't those magic?

Is there something in that code that will limit it to magic debuffs?
this line perhaps?
local name,_,_,_,dtype = UnitDebuff(unit, i)
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF Perfect - Adding Other Debuff Types


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