local match = string.match
local find = string.find
local gsub = string.gsub
local tonumber = tonumber
local hasOutfit = Player.hasOutfit
function Player.getUnownedOutfits(self)
local outfits = table.create(200, 0)
local sexPattern = 'type="'..self:getSex()..'"'
local lookPattern = 'looktype="(%d*)"'
local file = io.open([[data/xml/outfits.xml]])
local str = file:read("*a")
local i, j = find(str, sexPattern)
file:close()
while (i and j) do
local _i, _j = find(str, sexPattern, j)
local looktype = tonumber(match(str, lookPattern, i))
for addon = 3, 1, -1 do
if not hasOutfit(player, looktype, addon) then
outfits[looktype] = addon
break
end
end
i, j = _i, _j
end
return outfits
end