Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

Returns information about the source of the objects in a loot slot.

guid, quantity, ... = GetLootSourceInfo(lootSlot)

Arguments[]

lootSlot
number - index of the loot slot, ascending from 1 up to GetNumLootItems()

Returns[]

(Variable returns: guid1, quantity1, guid2, quantity2, ...)

guid
string - GUID of the source being looted. Can also return GameObject guids for objects like ore veins and herbs, and Item guids for containers like lockboxes.
quantity
number - Quantity of the object being looted from this source.

Example[]

Prints out the source guid and quantity of each loot source item individually.

local function OnEvent(self, event)
	for i = 1, GetNumLootItems() do
		local sources = {GetLootSourceInfo(i)}
		local _, name = GetLootSlotInfo(i)
		for j = 1, #sources, 2 do
			print(i, name, j, sources[j], sources[j+1])
		end
	end
end

local f = CreateFrame("Frame")
f:RegisterEvent("LOOT_OPENED")
f:SetScript("OnEvent", OnEvent)

API GetLootSourceInfo

Patch changes[]

Mists of Pandaria Patch 5.0.4 (2012-08-28): Added.

See also[]

Advertisement