1.6.0 - 8.0.1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
-- MxW (MxW Addon)
|
||||
-- By mikx
|
||||
-- https://git.mikx.ca/wow-addons/MxW_Addon
|
||||
-- https://git.mikx.xyz/wow/MxW_Addon
|
||||
-- Licensed under the GNU General Public License 3.0
|
||||
-- See included License file for more informations.
|
||||
|
||||
@@ -8,6 +8,8 @@ local MX = LibStub("AceAddon-3.0"):GetAddon("MxW");
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("MxW");
|
||||
|
||||
local numItems
|
||||
local iLink
|
||||
local value
|
||||
|
||||
local LOOT_OPENED_Frame = CreateFrame("Frame")
|
||||
LOOT_OPENED_Frame:RegisterEvent("LOOT_OPENED")
|
||||
@@ -22,50 +24,58 @@ LOOT_OPENED_Frame:SetScript("OnEvent",
|
||||
for i = 1, numItems do
|
||||
-- get loot slot link to get iteminfo, we can't use item name due to API limitation
|
||||
iLink = GetLootSlotLink(i)
|
||||
-- get the iteminfo only if the itemlink is not empty (EXEMPLE: money in a slot = empty)
|
||||
-- get the iteminfo and continue only if the itemlink is not empty (EXEMPLE: money in a slot = empty)
|
||||
if (iLink ~= nil) then
|
||||
-- get the iteminfo using the slot itemlink
|
||||
name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(iLink)
|
||||
end
|
||||
-- get the item value using the link, return nil if the item has no value
|
||||
value = MX.TSM:GetItemValue(link, "DBMarket");
|
||||
-- get the item value using the link, return nil if the item has no value
|
||||
value = MX.TSM:GetItemValue(link, "DBMarket");
|
||||
|
||||
-- MINIMUM QUALITY SETTINGS ------
|
||||
local eq = 2 -- equipable quality
|
||||
local mq = 1 -- mats quality
|
||||
local cq = 1 -- consumable quality
|
||||
local oq = 1 -- other quality
|
||||
local rq = 1 -- recipe quality
|
||||
----------------------------------
|
||||
-- if value is nil, the object is not BoE/not known by TSM & Looter is the player
|
||||
-- we use locales because the item class is localized by the client
|
||||
if (value ~= nil) then
|
||||
if(class == L["Alert_Class_Armor"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= eq) then
|
||||
MX:SendAlert(link,value);
|
||||
-- MINIMUM QUALITY SETTINGS ------
|
||||
local eq = 2 -- equipable quality
|
||||
local mq = 1 -- mats quality
|
||||
local cq = 1 -- consumable quality
|
||||
local oq = 1 -- other quality
|
||||
local rq = 1 -- recipe quality
|
||||
----------------------------------
|
||||
-- if value is nil, the object is not BoE/not known by TSM & Looter is the player
|
||||
-- we use locales because the item class is localized by the client
|
||||
if (value ~= nil and Settings_Alert_Enabled) then
|
||||
if(class == L["Alert_Class_Armor"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= eq) then
|
||||
MX:SendAlert(link,value);
|
||||
MX:ChatGuildLootMessage(link,value);
|
||||
end
|
||||
elseif(class == L["Alert_Class_Weapon"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= eq) then
|
||||
MX:SendAlert(link,value);
|
||||
MX:ChatGuildLootMessage(link,value);
|
||||
end
|
||||
elseif(class == L["Alert_Class_TradeGoods"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= mq) then
|
||||
MX:SendAlert(link,value);
|
||||
MX:ChatGuildLootMessage(link,value);
|
||||
end
|
||||
elseif(class == L["Alert_Class_Consumable"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= cq) then
|
||||
MX:SendAlert(link,value);
|
||||
MX:ChatGuildLootMessage(link,value);
|
||||
end
|
||||
elseif(class == L["Alert_Class_Misc"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= oq) then
|
||||
MX:SendAlert(link,value);
|
||||
MX:ChatGuildLootMessage(link,value);
|
||||
end
|
||||
elseif(class == "Recipe") then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= rq) then
|
||||
MX:SendAlert(link,value);
|
||||
MX:ChatGuildLootMessage(link,value);
|
||||
end
|
||||
end
|
||||
elseif(class == L["Alert_Class_Weapon"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= eq) then
|
||||
MX:SendAlert(link,value);
|
||||
end
|
||||
elseif(class == L["Alert_Class_TradeGoods"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= mq) then
|
||||
MX:SendAlert(link,value);
|
||||
end
|
||||
elseif(class == L["Alert_Class_Consumable"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= cq) then
|
||||
MX:SendAlert(link,value);
|
||||
end
|
||||
elseif(class == L["Alert_Class_Misc"]) then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= oq) then
|
||||
MX:SendAlert(link,value);
|
||||
end
|
||||
elseif(class == "Recipe") then
|
||||
if (value >= Farmer_Logic_MinAlert and quality >= rq) then
|
||||
MX:SendAlert(link,value);
|
||||
end
|
||||
end
|
||||
end
|
||||
value = nil
|
||||
iLink = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
-- MxW (MxW Addon)
|
||||
-- By mikx
|
||||
-- https://git.mikx.ca/wow-addons/MxW_Addon
|
||||
-- https://git.mikx.xyz/wow/MxW_Addon
|
||||
-- Licensed under the GNU General Public License 3.0
|
||||
-- See included License file for more informations.
|
||||
|
||||
@@ -17,19 +17,28 @@ PLAYER_MONEY_Frame:SetScript("OnEvent", function(self, event, ...)
|
||||
|
||||
if (DiffGold > 0) then -- Gold gain
|
||||
|
||||
local weekday, month, day, year = CalendarGetDate();
|
||||
-- Reset Global Daily Counter
|
||||
if (Farmer_Logic_Day ~= day) then
|
||||
Farmer_Money_DayGlobal = 0;
|
||||
MX:UpdateMainUI()
|
||||
Farmer_Logic_Day = day;
|
||||
end
|
||||
local date = C_Calendar.GetDate()
|
||||
local weekday = date.weekday
|
||||
local month = date.month
|
||||
local day = date.monthDay
|
||||
local year = date.year
|
||||
|
||||
-- Write to SavedVariables
|
||||
Farmer_Money_MonthGlobal = Farmer_Money_MonthGlobal + DiffGold;
|
||||
Farmer_Money_DayGlobal = Farmer_Money_DayGlobal + DiffGold;
|
||||
|
||||
if(Farmer_Money_DayGlobal >= DailyRecord and DailyRecordFlag == false) then
|
||||
MX:ChatGuildDailyRecord(DailyRecord)
|
||||
DailyRecord = Farmer_Money_DayGlobal;
|
||||
DailyRecordFlag = true;
|
||||
end
|
||||
|
||||
if(DailyRecordFlag) then
|
||||
DailyRecord = Farmer_Money_DayGlobal;
|
||||
end
|
||||
|
||||
MX:UpdateMainUI()
|
||||
MX:ChatGuildDailyMoneyThresholdMessage(Farmer_Money_DayGlobal)
|
||||
|
||||
elseif (DiffGold <= 0) then -- Gold lost
|
||||
|
||||
|
||||
Reference in New Issue
Block a user