local function GetFakeEntry(item) local guid = item and item:GetGUIDLow() if guid and dataMap[guid] then if entryMap[dataMap[guid]] then return entryMap[dataMap[guid]][guid] end endend

local function DeleteFakeFromDB(itemGUID) if dataMap[itemGUID] then if entryMap[dataMap[itemGUID]] then entryMap[dataMap[itemGUID]][itemGUID] = nil end dataMap[itemGUID] = nil end CharDBExecute("DELETE FROM custom_transmogrification WHERE GUID = "..itemGUID)end

if IsRangedWeapon(fiedClass, fiedSubClass) ~= IsRangedWeapon(fierClass, fierSubClass) then return false end

if fierSubClass ~= fiedSubClass and not IsRangedWeapon(fiedClass, fiedSubClass) then if fierClass == ITEM_CLASS_ARMOR and not AllowMixedArmorTypes then return false end if fierClass == ITEM_CLASS_WEAPON and not AllowMixedWeaponTypes then return false end end

for i = INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END-1 do if limit > 30 then break end local transmogrifier = player:GetItemByPos(INVENTORY_SLOT_BAG_0, i) if transmogrifier then local display = transmogrifier:GetDisplayId() if SuitableForTransmogrification(player, transmogrified, transmogrifier) then if not _items[lowGUID][display] then limit = limit + 1 _items[lowGUID][display] = {transmogrifier:GetBagSlot(), transmogrifier:GetSlot()} local popup = LocText(4, player).."\n\n"..transmogrifier:GetItemLink(player:GetDbcLocale()).."\n" if RequireToken then popup = popup.."\n"..TokenAmount.." x "..GetItemLink(TokenEntry, player:GetDbcLocale()) end player:GossipMenuAddItem(4, transmogrifier:GetItemLink(player:GetDbcLocale()), uiAction, display, false, popup, price) end end end end

for i = INVENTORY_SLOT_BAG_START, INVENTORY_SLOT_BAG_END-1 do local bag = player:GetItemByPos(INVENTORY_SLOT_BAG_0, i) if bag then for j = 0, bag:GetBagSize()-1 do if limit > 30 then break end local transmogrifier = player:GetItemByPos(i, j) if transmogrifier then local display = transmogrifier:GetDisplayId() if SuitableForTransmogrification(player, transmogrified, transmogrifier) then if not _items[lowGUID][display] then limit = limit + 1 _items[lowGUID][display] = {transmogrifier:GetBagSlot(), transmogrifier:GetSlot()} player:GossipMenuAddItem(4, transmogrifier:GetItemLink(player:GetDbcLocale()), uiAction, display, false, popup, price) end end end end end end

for slot = EQUIPMENT_SLOT_START, EQUIPMENT_SLOT_END-1 do local item = player:GetItemByPos(INVENTORY_SLOT_BAG_0, slot) if item then if entryMap[playerGUID] then if entryMap[playerGUID][item:GetGUIDLow()] then player:UpdateUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (item:GetSlot() * ITEM_SLOT_MULTIPLIER), entryMap[playerGUID][item:GetGUIDLow()]) end end end end endend