Skip to content

Commit 623f6dd

Browse files
LocalIdentityLocalIdentity
andauthored
Fix Split Personality not working with Monk and Druid starting points (#2171)
The naming of the item uses Templar and Shadow as starting points but since those classes don't exist yet in the game we don't have them in our class map either Made a different base class map that includes all the hidden classes so the map now works Also adds the item to the unique list as it was missing Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 035a04f commit 623f6dd

6 files changed

Lines changed: 56 additions & 16 deletions

File tree

spec/System/TestImportTab_spec.lua

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,18 @@ describe("ImportTab", function()
4747
it("imports Split Personality alternate class start from character JSON", function()
4848
local spec = build.spec
4949
local socketNode = spec.nodes[60735]
50-
local rangerStartPassive = spec.nodes[56651]
50+
local templarStartPassive = spec.nodes[13855]
5151
assert.is_not_nil(socketNode)
52-
assert.is_not_nil(rangerStartPassive)
52+
assert.is_not_nil(templarStartPassive)
53+
assert.is_nil(spec.tree.classNameMap.Templar)
54+
assert.are.equals(61525, spec.tree.classStartNodeNameMap.Templar)
5355

54-
local hashes = { socketNode.id, rangerStartPassive.id }
56+
local hashes = { socketNode.id, templarStartPassive.id }
5557
for _, pathNode in ipairs(socketNode.path or { }) do
5658
table.insert(hashes, pathNode.id)
5759
end
5860

59-
local rangerStart = spec.nodes[spec.tree.classes[spec.tree.classNameMap.Ranger].startNodeId]
60-
local importPayload = {
61+
build.importTab:ImportPassiveTreeAndJewels({
6162
name = "Split Import Test",
6263
class = "Witch2",
6364
league = "Test",
@@ -73,7 +74,7 @@ describe("ImportTab", function()
7374
ilvl = 84,
7475
properties = { },
7576
explicitMods = {
76-
"Can Allocate Passive Skills from the Ranger's starting point",
77+
"Can Allocate Passive Skills from the Templar's starting point",
7778
},
7879
},
7980
},
@@ -84,17 +85,14 @@ describe("ImportTab", function()
8485
jewel_data = { },
8586
quest_stats = { },
8687
},
87-
}
88-
89-
build.importTab:ImportPassiveTreeAndJewels(importPayload)
88+
})
9089

9190
local importedSpec = build.spec
9291
local importedJewel = build.itemsTab.items[importedSpec.jewels[socketNode.id]]
93-
assert.are.equals("Ranger", importedJewel.jewelData.alternateClassStart)
94-
95-
assert.are.equals(0, importedSpec.nodes[rangerStart.id].pathDist)
96-
assert.True(importedSpec.nodes[rangerStartPassive.id].alloc)
97-
assert.True(importedSpec.nodes[rangerStartPassive.id].connectedToStart)
92+
assert.are.equals("Templar", importedJewel.jewelData.alternateClassStart)
93+
assert.are.equals(0, importedSpec.nodes[spec.tree.classStartNodeNameMap.Templar].pathDist)
94+
assert.True(importedSpec.nodes[templarStartPassive.id].alloc)
95+
assert.True(importedSpec.nodes[templarStartPassive.id].connectedToStart)
9896
end)
9997
end)
10098

src/Classes/PassiveSpec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,8 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
12311231
if self.allocNodes[socketNodeId] then
12321232
local item = self:GetJewel(itemId)
12331233
local className = item and item.jewelData.alternateClassStart
1234-
local classData = className and self.tree.classes[self.tree.classNameMap[className]]
1235-
local startNode = classData and self.nodes[classData.startNodeId]
1234+
local startNodeId = self.tree.classStartNodeNameMap[className]
1235+
local startNode = startNodeId and self.nodes[startNodeId]
12361236
if startNode then
12371237
alternateClassStartNodes[startNode.id] = startNode
12381238
end

src/Classes/PassiveTree.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
8989
self.ascendNameMap = { }
9090
self.classIntegerIdMap = { }
9191
self.internalAscendNameMap = { }
92+
self.classStartNodeNameMap = { }
9293
self.classNotables = { }
9394

9495
for classId, class in pairs(self.classes) do
@@ -203,6 +204,7 @@ local PassiveTreeClass = newClass("PassiveTree", function(self, treeVersion)
203204
if node.classesStart then
204205
node.type = "ClassStart"
205206
for _, className in ipairs(node.classesStart) do
207+
self.classStartNodeNameMap[className] = node.id
206208
local class = self.classes[self.classNameMap[className]]
207209
if class ~= nil then
208210
class.startNodeId = node.id

src/Data/ModCache.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4899,7 +4899,11 @@ c["Buffs on you expire 10% slower"]={{[1]={[1]={skillType=5,type="SkillType"},fl
48994899
c["Bulwark"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Bulwark"}},nil}
49004900
c["Burning Enemies you kill have a 5% chance to Explode, dealing a"]={nil,"Burning Enemies you kill have a 5% chance to Explode, dealing a "}
49014901
c["Burning Enemies you kill have a 5% chance to Explode, dealing a tenth of their maximum Life as Fire Damage"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="Burning"},flags=0,keywordFlags=0,name="ExplodeMod",type="LIST",value={amount=10,keyOfScaledMod="value",type="Fire",value=5}},[2]={flags=0,keywordFlags=0,name="CanExplode",type="FLAG",value=true}},nil}
4902+
c["Can Allocate Passive Skills from the Mercenary's starting point"]={{[1]={flags=0,keywordFlags=0,name="AlternateClassStart",type="LIST",value="Mercenary"}},nil}
4903+
c["Can Allocate Passive Skills from the Ranger's starting point"]={{[1]={flags=0,keywordFlags=0,name="AlternateClassStart",type="LIST",value="Ranger"}},nil}
4904+
c["Can Allocate Passive Skills from the Shadow's starting point"]={{[1]={flags=0,keywordFlags=0,name="AlternateClassStart",type="LIST",value="Shadow"}},nil}
49024905
c["Can Allocate Passive Skills from the Sorceress's starting point"]={{[1]={flags=0,keywordFlags=0,name="AlternateClassStart",type="LIST",value="Sorceress"}},nil}
4906+
c["Can Allocate Passive Skills from the Templar's starting point"]={{[1]={flags=0,keywordFlags=0,name="AlternateClassStart",type="LIST",value="Templar"}},nil}
49034907
c["Can Allocate Passive Skills from the Warrior's starting point"]={{[1]={flags=0,keywordFlags=0,name="AlternateClassStart",type="LIST",value="Warrior"}},nil}
49044908
c["Can Attack as though using a One Handed Mace while both of your hand slots are empty"]={{[1]={flags=0,keywordFlags=0,name="CanAttackAsOneHandMaceUnarmed",type="FLAG",value=true}},nil}
49054909
c["Can Attack as though using a Quarterstaff while both of your hand slots are empty"]={nil,"Can Attack as though using a Quarterstaff while both of your hand slots are empty "}

src/Data/Uniques/jewel.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ Limited to: 3
5858
{variant:1}+4% to all Elemental Resistances per socketed Grand Spectrum
5959
{variant:2}+6% to all Elemental Resistances per socketed Grand Spectrum
6060
]],[[
61+
Split Personality
62+
Ruby
63+
Variant: Mercenary
64+
Variant: Ranger
65+
Variant: Shadow
66+
Variant: Sorceress
67+
Variant: Templar
68+
Variant: Warrior
69+
League: Runes of Aldur
70+
Limited to: 1
71+
{variant:2}Can Allocate Passive Skills from the Ranger's starting point
72+
{variant:3}Can Allocate Passive Skills from the Shadow's starting point
73+
{variant:4}Can Allocate Passive Skills from the Sorceress's starting point
74+
{variant:6}Can Allocate Passive Skills from the Warrior's starting point
75+
{variant:1}Can Allocate Passive Skills from the Mercenary's starting point
76+
{variant:5}Can Allocate Passive Skills from the Templar's starting point
77+
Corrupted
78+
]],[[
6179
Voices
6280
Sapphire
6381
Variant: 2 Sinister Sockets

src/Export/Uniques/jewel.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ Limited to: 3
5656
{variant:1}UniqueAllResistancePerStackableJewel1[4,4]
5757
{variant:2}UniqueAllResistancePerStackableJewel1
5858
]],[[
59+
Split Personality
60+
Ruby
61+
Variant: Mercenary
62+
Variant: Ranger
63+
Variant: Shadow
64+
Variant: Sorceress
65+
Variant: Templar
66+
Variant: Warrior
67+
League: Runes of Aldur
68+
Limited to: 1
69+
{variant:1}UniqueJewelSplitPersonalityClassStart4
70+
{variant:2}UniqueJewelSplitPersonalityClassStart2
71+
{variant:3}UniqueJewelSplitPersonalityClassStart6
72+
{variant:4}UniqueJewelSplitPersonalityClassStart3
73+
{variant:5}UniqueJewelSplitPersonalityClassStart5
74+
{variant:6}UniqueJewelSplitPersonalityClassStart1
75+
Corrupted
76+
]],[[
5977
Voices
6078
Sapphire
6179
Variant: 2 Sinister Sockets

0 commit comments

Comments
 (0)