Thread Tools Display Modes
04-26-07, 02:02 PM   #1
sirspikey
A Deviate Faerie Dragon
 
sirspikey's Avatar
Join Date: Feb 2007
Posts: 19
Recognise Hostiletargets buff

Hi I'm trying to make a button appear/disapper when target buff it self but I can't find any command that could return the buff it is using, tried UnitBuff("target",id) and UnitDebuff("target",id) but they only return nil

Code:
function debuffenemybars()

M=0

local i=1;

local name, x2, x3, x4, myBuffType = UnitBuff("target",i)

	while ( name ~= nil ) do
        if ( myBuffType == "Magic") then
			M=M+1
   		end
        DEFAULT_CHAT_FRAME:AddMessage("Antal" ..M)
        i=i+1
       	name, x2, x3, x4, myBuffType = UnitBuff("target",i)

    end

	if M==0 then
	    barstate(DebuffEnemyBar,0);
	end

	if M>=1 then
		barstate(DebuffEnemyBar,1);
	end

end

any ideas?
  Reply With Quote
04-26-07, 02:29 PM   #2
Korred
A Flamescale Wyrmkin
Join Date: Dec 2006
Posts: 101
First, i'm pretty sure you can't show and hide buttons whilst in combat, you can change their colors and maybe changing opacity would work but 'Hide/show' no worky.

YOu also won't be able to get a list of buffs an enemy target is using, you'll have to do what SpellAlert does and watch spell cast events. You'll need to parse and use libraries to figure out whether the spell they just cast is a buff for their class and if it's on themselves or on another player.

Also, this is merely what I vaguely remember.
  Reply With Quote
04-26-07, 02:42 PM   #3
sirspikey
A Deviate Faerie Dragon
 
sirspikey's Avatar
Join Date: Feb 2007
Posts: 19
I'm with you so far, that I have to somehow extract the info like Pion does and I'm also using the opacity to show/hide (currently using Bongos bars).

But I'm not that good at coding in lua yet and i don't know how to extract that data, and I also failed in finding any wowAPI-function that can return the data of a spell that i don't allready have in my current chars spellbook.

But I wonder if there is a lib of spells that i can call on to retrive the bufftype (Magic, poison...)'
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Recognise Hostiletargets buff


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