Quantcast WoWInterface - View Single Post - Show battle pet level
View Single Post
12-31-18, 02:15 AM   #5
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,696
For reference, the default [level] tag:
https://github.com/oUF-wow/oUF/blob/....lua#L221-L232

Lua Code:
  1. ['level'] = [[function(u)
  2.     local l = UnitLevel(u)
  3.     if(UnitIsWildBattlePet(u) or UnitIsBattlePetCompanion(u)) then
  4.         l = UnitBattlePetLevel(u)
  5.     end
  6.     if(l > 0) then
  7.         return l
  8.     else
  9.         return '??'
  10.     end
  11. end]],
  Reply With Quote