From 18a55aaf2802f2ed0e03a059a033ec53f841c4dd Mon Sep 17 00:00:00 2001 From: Silversage of Eitrigg Date: Sun, 25 Sep 2011 17:30:13 -0700 Subject: [PATCH] Handles red, yellow, blue sockets --- SageGearLevelTooltip.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SageGearLevelTooltip.lua b/SageGearLevelTooltip.lua index cf2cfb4..a001a3f 100644 --- a/SageGearLevelTooltip.lua +++ b/SageGearLevelTooltip.lua @@ -150,6 +150,7 @@ local SimplePawnEvaluator do local stats = self:_GetItemStats(itemLink) local total = 0 local missedStat, missedStatLabel = nil, nil + print("stat eval") for k,v in pairs(stats) do local stat = ITEM_MOD_NAME_MAP[k] if not stat then @@ -197,6 +198,16 @@ local BestReforgedEvaluator do self.super:_Initialize(instance) instance.coefficients = coefficients instance.label = label + + -- handle sockets + local bestStatValue = 0 + for i,stat in ipairs({"Stamina", "Strength", "Agility", "Intellect", "Spirit"}) do + bestStatValue = math.max(bestStatValue, instance.coefficients[stat] or 0) + end + local socketValue = bestStatValue * 40 -- cata blue gems + instance.coefficients.RedSocket = math.max(socketValue, instance.coefficients.RedSocket or 0) + instance.coefficients.BlueSocket = math.max(socketValue, instance.coefficients.BlueSocket or 0) + instance.coefficients.YellowSocket = math.max(socketValue, instance.coefficients.YellowSocket or 0) end function class:_GetItemStats(itemLink) -- 1.7.9.5