Skip to content

Instantly share code, notes, and snippets.

@yaroot
Created October 23, 2009 12:54
Show Gist options
  • Save yaroot/216858 to your computer and use it in GitHub Desktop.
Save yaroot/216858 to your computer and use it in GitHub Desktop.
local function isLeader(u)
return ((UnitInParty(u) or UnitInRaid(u)) and UnitIsPartyLeader(u))
end
local function isMasterLoot(u)
local method, party, raid = GetLootMethod()
local unit
if method == 'master' then
if party then
unit = party == 0 and 'player' or 'party' .. party
elseif raid then
unit = 'raid' .. raid
end
return unit and UnitIsUnit(u, unit)
end
end
local function func(unit)
if isLeader(unit) and isMasterLoot(unit) then
-- blah blah blah
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment