diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index 125326a6af..c3bf54082b 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -1462,9 +1462,17 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi end end end + local goldCost = data.goldRespecPrices[build.characterLevel] + if node.ascendancyName then + goldCost = goldCost * 5 + end if node.depends and #node.depends > 1 then tooltip:AddSeparator(14) tooltip:AddLine(14, "^7"..#node.depends .. " points gained from unallocating these nodes") + tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate these nodes") + tooltip:AddLine(14, colorCodes.TIP) + elseif node.alloc then + tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate this node") tooltip:AddLine(14, colorCodes.TIP) end diff --git a/src/Classes/TreeTab.lua b/src/Classes/TreeTab.lua index 5fb65dbf4a..13781def55 100644 --- a/src/Classes/TreeTab.lua +++ b/src/Classes/TreeTab.lua @@ -68,24 +68,36 @@ local TreeTabClass = newClass("TreeTab", "ControlHost", function(self, build) end if spec.curClassId == self.build.spec.curClassId then local respec = 0 + local respecAscendancy = 0 for nodeId, node in pairs(self.build.spec.allocNodes) do -- Assumption: Nodes >= 65536 are small cluster passives. if node.type ~= "ClassStart" and node.type ~= "AscendClassStart" and (self.build.spec.tree.clusterNodeMap[node.dn] == nil or node.isKeystone or node.isJewelSocket) and nodeId < 65536 and not spec.allocNodes[nodeId] then if node.ascendancyName then - respec = respec + 5 + respecAscendancy = respecAscendancy + 1 else respec = respec + 1 end end end - if respec > 0 then - tooltip:AddLine(16, "^7Switching to this tree requires "..respec.." refund points.") + if respec > 0 or respecAscendancy > 0 then + local goldCost = data.goldRespecPrices[build.characterLevel] + local totalGold = (respec * goldCost) + (respecAscendancy * goldCost * 5) + local goldStr = formatNumSep(tostring(totalGold)) + tooltip:AddLine(16, "^xFFD700" .. goldStr .. " Gold ^7required to switch to this tree.") + if respec > 0 then + local nodeWord = respec == 1 and "Passive node to be refunded" or "Passive nodes to be refunded" + tooltip:AddLine(16, s_format("^7\t%d %s.", respec, nodeWord)) + end + if respecAscendancy > 0 then + local ascendWord = respecAscendancy == 1 and "Ascendancy node to be refunded" or "Ascendancy nodes to be refunded" + tooltip:AddLine(16, s_format("^7\t%d %s.", respecAscendancy, ascendWord)) + end end end end - tooltip:AddLine(16, "Game Version: "..treeVersions[spec.treeVersion].display) + tooltip:AddLine(16, "^7Game Version: "..treeVersions[spec.treeVersion].display) end end end diff --git a/src/Data/Misc.lua b/src/Data/Misc.lua index 6d2333db39..28bb4d4054 100644 --- a/src/Data/Misc.lua +++ b/src/Data/Misc.lua @@ -358,3 +358,5 @@ data.hollowPalmAddedPhys = { [39] = { 302, 452 }, [40] = { 308, 462 }, } +-- From GoldRespecPrices.dat +data.goldRespecPrices = { 15, 19, 25, 31, 39, 46, 60, 73, 85, 98, 113, 128, 145, 163, 182, 211, 225, 241, 257, 273, 290, 308, 326, 344, 364, 384, 404, 425, 447, 470, 493, 517, 542, 567, 593, 620, 648, 676, 706, 736, 767, 799, 832, 866, 900, 936, 973, 1010, 1049, 1089, 1130, 1172, 1215, 1259, 1304, 1351, 1399, 1448, 1498, 1550, 1603, 1657, 1713, 1770, 1829, 1889, 1950, 2014, 2078, 2145, 2213, 2282, 2354, 2427, 2502, 2578, 2657, 2737, 2820, 2904, 3089, 3281, 3480, 3686, 3899, 4120, 4349, 4585, 4829, 5081, 5509, 5952, 6412, 6889, 7383, 7895, 8425, 8974, 9542, 10129, } diff --git a/src/Export/Scripts/miscdata.lua b/src/Export/Scripts/miscdata.lua index b5eac0568e..a8be2c8632 100644 --- a/src/Export/Scripts/miscdata.lua +++ b/src/Export/Scripts/miscdata.lua @@ -156,6 +156,13 @@ for row in dat("FlatPhysicalDamageValues"):Rows() do end out:write('}\n') +out:write('-- From GoldRespecPrices.dat\n') +out:write('data.goldRespecPrices = { ') +for row in dat("GoldRespecPrices"):Rows() do + out:write(row.Cost .. ', ') +end +out:write('}\n') + out:close() print("Misc data exported.")