Thread Tools Display Modes
06-27-06, 04:33 PM   #1
Nyrine
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 23
Finding what 'buff' is on a weapon

How do I go about this ?

The following code will correctly detect if my weapon has a buff (ie Windfury, Rockbiter, an oil etc)

Code:
local hmhe, mhe, mhc, hoe, ohe, ohc = GetWeaponEnchantInfo()
if (hmhe) then
  -- weapon has a buff
else
  -- weapon doesnt have a buff
end
But how do I find which buff is on it ? Mousing over the item in my inventory shows the buff on the tooltip, so its obviously possible.

Is there a way of doing it, without creating a tooltip and parsing all the lines in it ?
  Reply With Quote
06-27-06, 05:20 PM   #2
BTShrump
A Cyclonian
 
BTShrump's Avatar
Join Date: Mar 2006
Posts: 46
WeaponRebuff Works great
__________________

Time Spent in WOW:
3 hours a night to raid
2 hours a day to farm
300 hours a day to work on UI
>_<
  Reply With Quote
06-28-06, 01:50 PM   #3
Nyrine
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2006
Posts: 23
It too uses a hidden tooltip though. Oh well, I guess i'll keep going the way I have been until I learn better =)

Thanks though !
  Reply With Quote
06-28-06, 04:04 PM   #4
BTShrump
A Cyclonian
 
BTShrump's Avatar
Join Date: Mar 2006
Posts: 46
guess I just dont know what you mean by hidden tooltip =)
__________________

Time Spent in WOW:
3 hours a night to raid
2 hours a day to farm
300 hours a day to work on UI
>_<
  Reply With Quote
07-15-06, 12:54 AM   #5
Jayman405
A Defias Bandit
Join Date: Jul 2006
Posts: 3
I am also seeking this info.

This is a little interesting, if not helpful.
http://www.wowwiki.com/API_TYPE_ItemString
Code:
-- Usage: Put this code in your addon and call 
-- the /script line in game while targeting self.
--
-- /script mainhandinfo()

function mainhandinfo()

	local mainHandLink = GetInventoryItemLink("player", GetInventorySlotInfo("MainHandSlot"))
	DEFAULT_CHAT_FRAME:AddMessage(mainHandLink)
	local _, _, itemId, otherIds = strfind(mainHandLink, "(%d+)(:%d+:%d+:%d+)")
	DEFAULT_CHAT_FRAME:AddMessage(itemId .. otherIds )

	local hmhe, mhe, mhc, hoe, ohe, ohc = GetWeaponEnchantInfo(itemId)
	if (hmhe) then
 		-- weapon has a buff
		DEFAULT_CHAT_FRAME:AddMessage("Temp Enchant Applied")
	else
 		-- weapon doesnt have a buff
		DEFAULT_CHAT_FRAME:AddMessage("No Temp Enchant Applied")
	end
end

Last edited by Jayman405 : 07-15-06 at 01:00 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Finding what 'buff' is on a weapon


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