Posted by Yonaz on Sat, 14 Aug 2010 21:32:07
From what I understand, UnitIsPlusMob isn't used in WoW anymore, and now I wonder how to get the new string UnitClassification() to work instead. Below is some of the old code I just can't get working:
local function levelString(unit) if UnitExists(unit) then local l = UnitLevel(unit); local s = tostring(l); if l < 1 or l > 100 then s = '??'; end if UnitIsPlusMob(unit) then s = s .. '+'; end return s; else return ''; end end
Posted by jnwhiteh on Thu, 19 Aug 2010 11:25:49
function UnitLevelPlus(unit) if UnitExists(unit) then local level = UnitLevel(unit) local s if level == -1 then s = "??" else s = tostring(level) end local cl = UnitClassification(unit) if cl == "elite" or cl == "rareelite" or cl == "worldboss" then s = s .. "+" end return s else return "" end end
Should work. You were using UnitClassification() wrong. It ALWAYS returns something, you need to check what is returned.