So I used some code I found at this link:
http://us.battle.net/wow/en/forum/topic/8481388146 for scanning tooltips. Got the name of the inventory item, works on me.
Tried it on a guy next to me, worked. Super!
Tried it on the next guy next me to me. Failed. Hmm... why is that nil... turns out
GetItemInfo(itemName) only works if I own the gear :-(
Guess I'm out of luck going that route too
Code if it helps at all... excuse the sloppiness of it.
Lua Code:
CreateFrame( "GameTooltip", "MyScanningTooltip", nil, "GameTooltipTemplate" ); -- Tooltip name cannot be nil
local function ScanTooltipOfUnitSlotForTransmog(unit,slot)
local tooltip = MyScanningTooltip
local isTransmogrified = false
local itemName = nil
tooltip:SetOwner( WorldFrame, "ANCHOR_NONE" ); -- does a ClearLines() already
tooltip:SetInventoryItem(unit,slot)
for i=1,MyScanningTooltip:NumLines() do
local left = _G["MyScanningTooltipTextLeft"..i]:GetText()
if left then
if isTransmogrified then
-- The line after the Transmog header has been found will be the name
-- might have to parse Illusion: Hidden
itemName = left
break -- return isTransmogrified, itemName
end
if left == "Transmogrified to:" then -- Deal with localization - any better patterns to match?
isTransmogrified = true
end
end
end
return isTransmogrified, itemName
end
transmogSlots = { InspectHeadSlot, InspectShoulderSlot, InspectBackSlot, InspectChestSlot, InspectWristSlot, InspectHandsSlot, InspectWaistSlot, InspectLegsSlot, InspectFeetSlot, InspectMainHandSlot, InspectSecondaryHandSlot }
-- Inspect the target manually before you try unless you've targetted yourself
unit = "playertarget"
for i, slot in ipairs(transmogSlots) do
slotId = slot:GetID()
local isTransmogrified, itemName = ScanTooltipOfUnitSlotForTransmog(unit,slotId)
if isTransmogrified then
local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(itemName)
if link then
-- Can't call by itemName unless I have it in my bags... ugh!
print (format("Slot %s is transmogrified to %s.", slotId, link))
else
print (format("Slot %s is transmogrified to %s", slotId, itemName))
end
end
end