Skip to content

Commit ae2200a

Browse files
authored
Add Gold Respec Prices to Tooltip (#9175)
1 parent 0561312 commit ae2200a

File tree

6 files changed

+85
-4
lines changed

6 files changed

+85
-4
lines changed

src/Classes/PassiveTreeView.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,9 +1230,17 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build)
12301230
end
12311231
end
12321232
end
1233+
local goldCost = data.goldRespecPrices[build.characterLevel]
1234+
if node.ascendancyName then
1235+
goldCost = goldCost * 5
1236+
end
12331237
if node.depends and #node.depends > 1 then
12341238
tooltip:AddSeparator(14)
12351239
tooltip:AddLine(14, "^7"..#node.depends .. " points gained from unallocating these nodes")
1240+
tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate these nodes")
1241+
tooltip:AddLine(14, colorCodes.TIP)
1242+
elseif node.alloc then
1243+
tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate this node")
12361244
tooltip:AddLine(14, colorCodes.TIP)
12371245
end
12381246
if node.type == "Socket" then

src/Classes/TreeTab.lua

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,36 @@ local TreeTabClass = newClass("TreeTab", "ControlHost", function(self, build)
6868
end
6969
if spec.curClassId == self.build.spec.curClassId then
7070
local respec = 0
71+
local respecAscendancy = 0
7172
for nodeId, node in pairs(self.build.spec.allocNodes) do
7273
-- Assumption: Nodes >= 65536 are small cluster passives.
7374
if node.type ~= "ClassStart" and node.type ~= "AscendClassStart"
7475
and (self.build.spec.tree.clusterNodeMap[node.dn] == nil or node.isKeystone or node.isJewelSocket) and nodeId < 65536
7576
and not spec.allocNodes[nodeId] then
7677
if node.ascendancyName then
77-
respec = respec + 5
78+
respecAscendancy = respecAscendancy + 1
7879
else
7980
respec = respec + 1
8081
end
8182
end
8283
end
83-
if respec > 0 then
84-
tooltip:AddLine(16, "^7Switching to this tree requires "..respec.." refund points.")
84+
if respec > 0 or respecAscendancy > 0 then
85+
local goldCost = data.goldRespecPrices[build.characterLevel]
86+
local totalGold = (respec * goldCost) + (respecAscendancy * goldCost * 5)
87+
local goldStr = formatNumSep(tostring(totalGold))
88+
tooltip:AddLine(16, "^xFFD700" .. goldStr .. " Gold ^7required to switch to this tree.")
89+
if respec > 0 then
90+
local nodeWord = respec == 1 and "Passive node to be refunded" or "Passive nodes to be refunded"
91+
tooltip:AddLine(16, s_format("^7\t%d %s.", respec, nodeWord))
92+
end
93+
if respecAscendancy > 0 then
94+
local ascendWord = respecAscendancy == 1 and "Ascendancy node to be refunded" or "Ascendancy nodes to be refunded"
95+
tooltip:AddLine(16, s_format("^7\t%d %s.", respecAscendancy, ascendWord))
96+
end
8597
end
8698
end
8799
end
88-
tooltip:AddLine(16, "Game Version: "..treeVersions[spec.treeVersion].display)
100+
tooltip:AddLine(16, "^7Game Version: "..treeVersions[spec.treeVersion].display)
89101
end
90102
end
91103
end

src/Data/Misc.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,5 @@ data.mapLevelLifeMult = { [66] = 1.01, [67] = 1.03, [68] = 1.05, [69] = 1.09, [7
316316
-- From MonsterMapBossDifficulty.dat
317317
data.mapLevelBossLifeMult = { [1] = 1.5, [2] = 1.52, [3] = 1.54, [4] = 1.56, [5] = 1.58, [6] = 1.6, [7] = 1.62, [8] = 1.64, [9] = 1.66, [10] = 1.68, [11] = 1.7, [12] = 1.72, [13] = 1.74, [14] = 1.76, [15] = 1.78, [16] = 1.8, [17] = 1.82, [18] = 1.84, [19] = 1.86, [20] = 1.88, [21] = 1.9, [22] = 1.92, [23] = 1.94, [24] = 1.96, [25] = 1.98, [26] = 2, [27] = 2.02, [28] = 2.04, [29] = 2.06, [30] = 2.08, [31] = 2.1, [32] = 2.12, [33] = 2.14, [34] = 2.16, [35] = 2.18, [36] = 2.2, [37] = 2.22, [38] = 2.24, [39] = 2.26, [40] = 2.28, [41] = 2.3, [42] = 2.32, [43] = 2.34, [44] = 2.36, [45] = 2.38, [46] = 2.4, [47] = 2.42, [48] = 2.44, [49] = 2.46, [50] = 2.48, [51] = 2.5, [52] = 2.52, [53] = 2.54, [54] = 2.56, [55] = 2.58, [56] = 2.6, [57] = 2.62, [58] = 2.64, [59] = 2.66, [60] = 2.68, [61] = 2.7, [62] = 2.72, [63] = 2.74, [64] = 2.76, [65] = 2.78, [66] = 2.8, [67] = 2.8, [68] = 2.8, [69] = 3.03, [70] = 3.16, [71] = 3.32, [72] = 3.48, [73] = 5.63, [74] = 5.97, [75] = 6.32, [76] = 6.66, [77] = 6.99, [78] = 10.46, [79] = 11.32, [80] = 13.01, [81] = 15.43, [82] = 17.2, [83] = 19.64, [84] = 21.46, [85] = 21.46, [86] = 21.46, [87] = 21.46, [88] = 21.46, [89] = 21.46, [90] = 21.46, }
318318
data.mapLevelBossAilmentMult = { [1] = 0.81, [2] = 0.81, [3] = 0.81, [4] = 0.81, [5] = 0.81, [6] = 0.81, [7] = 0.81, [8] = 0.81, [9] = 0.81, [10] = 0.81, [11] = 0.81, [12] = 0.81, [13] = 0.81, [14] = 0.81, [15] = 0.81, [16] = 0.81, [17] = 0.81, [18] = 0.81, [19] = 0.81, [20] = 0.81, [21] = 0.81, [22] = 0.81, [23] = 0.81, [24] = 0.81, [25] = 0.81, [26] = 0.81, [27] = 0.81, [28] = 0.81, [29] = 0.81, [30] = 0.81, [31] = 0.81, [32] = 0.81, [33] = 0.81, [34] = 0.81, [35] = 0.81, [36] = 0.81, [37] = 0.81, [38] = 0.81, [39] = 0.81, [40] = 0.81, [41] = 0.81, [42] = 0.81, [43] = 0.81, [44] = 0.81, [45] = 0.81, [46] = 0.81, [47] = 0.81, [48] = 0.81, [49] = 0.81, [50] = 0.81, [51] = 0.8, [52] = 0.79, [53] = 0.78, [54] = 0.77, [55] = 0.76, [56] = 0.75, [57] = 0.74, [58] = 0.73, [59] = 0.72, [60] = 0.71, [61] = 0.7, [62] = 0.69, [63] = 0.68, [64] = 0.67, [65] = 0.66, [66] = 0.65, [67] = 0.64, [68] = 0.63, [69] = 0.59, [70] = 0.58, [71] = 0.57, [72] = 0.56, [73] = 0.55, [74] = 0.53, [75] = 0.52, [76] = 0.51, [77] = 0.5, [78] = 0.49, [79] = 0.48, [80] = 0.48, [81] = 0.47, [82] = 0.47, [83] = 0.47, [84] = 0.47, [85] = 0.47, [86] = 0.47, [87] = 0.47, [88] = 0.47, [89] = 0.47, [90] = 0.47, }
319+
-- From VillageBalancePerLevelShared.dat
320+
data.goldRespecPrices = { 4, 4, 4, 5, 5, 6, 6, 7, 8, 8, 9, 11, 12, 14, 15, 17, 18, 20, 22, 24, 26, 28, 31, 34, 36, 39, 43, 46, 50, 54, 58, 62, 67, 72, 83, 90, 97, 105, 113, 121, 130, 151, 161, 171, 182, 209, 222, 237, 252, 267, 295, 313, 333, 354, 376, 427, 452, 482, 513, 546, 618, 656, 694, 733, 773, 816, 860, 892, 921, 1055, 1203, 1365, 1541, 1748, 1974, 2221, 2490, 2770, 3073, 3400, 3752, 4131, 4538, 4976, 5444, 5967, 6526, 7126, 7766, 8450, 9851, 11380, 13042, 14847, 16801, 18914, 21192, 23647, 26286, 29119, }

src/Export/Classes/GGPKData.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ function GGPKClass:GetNeededFiles()
278278
"Data/BrequelGraftTypes.dat",
279279
"Data/BrequelGraftSkillStats.dat",
280280
"Data/BrequelGraftGrantedSkillLevels.dat",
281+
"Data/VillageBalancePerLevelShared.dat",
281282
}
282283
local txtFiles = {
283284
"Metadata/StatDescriptions/passive_skill_aura_stat_descriptions.txt",

src/Export/Scripts/miscdata.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ out:write('-- From MonsterMapBossDifficulty.dat\n')
9090
out:write('data.mapLevelBossLifeMult = { '..mapBossLifeMult..'}\n')
9191
out:write('data.mapLevelBossAilmentMult = { '..mapBossAilmentMult..'}\n')
9292

93+
out:write('-- From VillageBalancePerLevelShared.dat\n')
94+
out:write('data.goldRespecPrices = { ')
95+
for row in dat("VillageBalancePerLevelShared"):Rows() do
96+
out:write(row.GoldRespec .. ', ')
97+
end
98+
out:write('}\n')
99+
93100
out:close()
94101

95102
print("Misc data exported.")

src/Export/spec.lua

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13461,6 +13461,57 @@ return {
1346113461
},
1346213462
userinterfacemodecondition={
1346313463
},
13464+
villagebalanceperlevelshared={
13465+
[1]={
13466+
list=false,
13467+
name="Level",
13468+
refTo="",
13469+
type="Int",
13470+
width=150
13471+
},
13472+
[2]={
13473+
list=false,
13474+
name="",
13475+
refTo="",
13476+
type="Int",
13477+
width=150
13478+
},
13479+
[3]={
13480+
list=false,
13481+
name="",
13482+
refTo="",
13483+
type="Int",
13484+
width=150
13485+
},
13486+
[4]={
13487+
list=false,
13488+
name="GoldRespec",
13489+
refTo="",
13490+
type="Int",
13491+
width=150
13492+
},
13493+
[5]={
13494+
list=false,
13495+
name="",
13496+
refTo="",
13497+
type="Int",
13498+
width=150
13499+
},
13500+
[6]={
13501+
list=false,
13502+
name="",
13503+
refTo="",
13504+
type="Int",
13505+
width=150
13506+
},
13507+
[7]={
13508+
list=false,
13509+
name="",
13510+
refTo="",
13511+
type="Int",
13512+
width=150
13513+
}
13514+
},
1346413515
villageuniquedisenchantvalues={
1346513516
[1]={
1346613517
list=false,

0 commit comments

Comments
 (0)