PageRenderTime 67ms CodeModel.GetById 64ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/Tukui/modules/loot/autodez.lua

http://github.com/Asphyxia/Tukui
Lua | 25 lines | 19 code | 1 blank | 5 comment | 7 complexity | dcb8b36a2e58b8404074eac67a8857ff MD5 | raw file
 1local 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
 8if C["loot"].autogreed == true then
 9	local autogreed = CreateFrame("frame")
10	autogreed:RegisterEvent("START_LOOT_ROLL")
11	autogreed:SetScript("OnEvent", function(self, event, id)
12		local name = select(2, GetLootRollItemInfo(id))
13		if (name == select(1, GetItemInfo(43102))) then
14			RollOnLoot(id, 2)
15		end
16		if T.level ~= MAX_PLAYER_LEVEL then return end
17		if(id and select(4, GetLootRollItemInfo(id))==2 and not (select(5, GetLootRollItemInfo(id)))) then
18			if RollOnLoot(id, 3) then
19				RollOnLoot(id, 3)
20			else
21				RollOnLoot(id, 2)
22			end
23		end
24	end)
25end