/Tukui/modules/loot/autodez.lua

http://github.com/Asphyxia/Tukui · Lua · 25 lines · 19 code · 1 blank · 5 comment · 10 complexity · dcb8b36a2e58b8404074eac67a8857ff MD5 · raw file

  1. local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
  2. --------------------------------------------------------------------------
  3. -- auto-dez (priority) or auto-greed green item at max level
  4. -- yes... you are right... i'm totally lazy
  5. -- auto-greed Frozen Orbs
  6. --------------------------------------------------------------------------
  7. if C["loot"].autogreed == true then
  8. local autogreed = CreateFrame("frame")
  9. autogreed:RegisterEvent("START_LOOT_ROLL")
  10. autogreed:SetScript("OnEvent", function(self, event, id)
  11. local name = select(2, GetLootRollItemInfo(id))
  12. if (name == select(1, GetItemInfo(43102))) then
  13. RollOnLoot(id, 2)
  14. end
  15. if T.level ~= MAX_PLAYER_LEVEL then return end
  16. if(id and select(4, GetLootRollItemInfo(id))==2 and not (select(5, GetLootRollItemInfo(id)))) then
  17. if RollOnLoot(id, 3) then
  18. RollOnLoot(id, 3)
  19. else
  20. RollOnLoot(id, 2)
  21. end
  22. end
  23. end)
  24. end