API RollOnLoot

From Wowpedia
Jump to: navigation, search

Roll on the Loot roll identified with Rollid, roll is nil when passing, otherwise it uses 1 to roll on loot.

RollOnLoot(rollID[, rollType]);

Arguments

rollID 
Number - The number increases with every roll you have in a party. Till how high it counts is currently unknown.
rollType 
Number/nil - 0 or nil to pass, 1 to roll Need, 2 to roll Greed, or 3 to roll Disenchant.

Example

The code snippet below will display a message when you roll or pass on a roll. This could easily be changed to record how many times you roll on loot.

hooksecurefunc("RollOnLoot", function(rollID, rollType)
 if (roll) then
   DEFAULT_CHAT_FRAME:AddMessage("You rolled on the item with id: " .. rollID );
 else
   DEFAULT_CHAT_FRAME:AddMessage("You passed on the item with id: " .. rollID );
 end
end)