-- brotherhobbes@gmail.com assert( oRA, "oRA not found!") ------------------------------ -- Are you local? -- ------------------------------ local L = AceLibrary("AceLocale-2.2"):new("oRALLootMethod") ---------------------------- -- Localization -- ---------------------------- L:RegisterTranslations("enUS", function() return { ["lootmethodleader"] = true, ["lootmethod"] = true, ["Loot Method"] = true, ["Leader/LootMethod"] = true, ["Options for loot method."] = true, ["freeforall"] = true, ["roundrobin"] = true, ["master"] = true, ["group"] = true, ["needbeforegreed"] = true, [""] = true, } end ) ---------------------------------- -- Module Declaration -- ---------------------------------- oRALLootMethod = oRA:NewModule(L["lootmethodleader"]) oRALLootMethod.defaults = { method = L["freeforall"], } oRALLootMethod.leader = true oRALLootMethod.name = L["Leader/LootMethod"] oRALLootMethod.consoleCmd = L["lootmethod"] oRALLootMethod.consoleOptions = { type = "text", name = L["Loot Method"], desc = L["Options for loot method."], get = function() return oRALLootMethod.db.profile.method end, set = function(v) oRALLootMethod:PerformLootMethod(v) end, validate = { L["freeforall"], L["roundrobin"], L["master"], L["group"], L["needbeforegreed"] }, usage = L[""], } ------------------------------ -- Initialization -- ------------------------------ function oRALLootMethod:OnEnable() if self.db.profile.method ~= nil then oRALLootMethod:PerformLootMethod(self.db.profile.method) end end function oRALLootMethod:OnDisable() self:UnregisterAllEvents() end ---------------------- -- Command handlers -- ---------------------- function oRALLootMethod:PerformLootMethod(method) if not self:IsPromoted() then return end self.db.profile.method = method -- SetLootMethod("method"{,"masterPlayer" or ,threshold}) -- method "group", "freeforall", "master", "neeedbeforegreed", "roundrobin". -- threshold 0 poor 1 common 2 uncommon 3 rare 4 epic 5 legendary 6 artifact if method == "master" then SetLootMethod(method, UnitName("player")) else SetLootMethod(method) end end