Skip to content

Commit c819a68

Browse files
RegisleLocalIdentity
andauthored
Update fix_ascendancy_positions.py to support new extra tree nodes (PathOfBuildingCommunity#4357)
* add Initial support for adding non-Tree nodes to Tree (Nine lives) * update positions and add other dummy nodes * separate stats and reminder text and add new nodes * rest of nodes * Fix comma * fix spelling of sapped * update spec.lua for passiveSkills * remove unrelated spec * update file to hardcode group and node IDs, and correct ascendency * update to new tree * spelling fix Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 872d4e2 commit c819a68

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

fix_ascendancy_positions.py

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
logging.basicConfig(level=logging.INFO)
1010

1111

12-
@dataclasses.dataclass(frozen=True, slots=True)
12+
@dataclasses.dataclass(frozen=True) #, slots=True) #, slots breaks becouse its already defined?
1313
class Point2D:
1414
"""Two-dimensional point. Supports subtracting points."""
1515
x: int
@@ -40,6 +40,42 @@ def __sub__(self, other: Point2D) -> Point2D:
4040
"Saboteur": Point2D(10200, -2200),
4141
"Ascendant": Point2D(-7800, 7200),
4242
}
43+
EXTRA_NODES = {
44+
"Necromancer": [{"Node": {"name": "Nine Lives", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/Int.png", "isNotable": True, "skill" : 27602},
45+
"offset": Point2D(-1500, -1000)}],
46+
"Guardian": [{"Node": {"name": "Searing Purity", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/StrInt.png", "isNotable": True, "skill" : 57568},
47+
"offset": Point2D(-1000, 1500)}],
48+
"Berserker": [{"Node": {"name": "Indomitable Resolve", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/Str.png", "isNotable": True, "skill" : 52435},
49+
"offset": Point2D(-1000, 0)}],
50+
"Ascendant": [{"Node": {"name": "Unleashed Potential", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/SkillPoint.png", "skill" : 19355},
51+
"offset": Point2D(-1000, 1000)}],
52+
"Champion": [{"Node": {"name": "Fatal Flourish", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/StrDex.png", "isNotable": True, "skill" : 42469},
53+
"offset": Point2D(0, 1000)}],
54+
"Raider": [{"Node": {"name": "Fury of Nature", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/Dex.png", "isNotable": True, "skill" : 18054},
55+
"offset": Point2D(1000, -1500)}],
56+
"Saboteur": [{"Node": {"name": "Harness the Void", "icon": "Art/2DArt/SkillIcons/passives/Ascendants/DexInt.png", "isNotable": True, "skill" : 57331},
57+
"offset": Point2D(1000, -1500)}],
58+
}
59+
EXTRA_NODE_IDS = { #these can be any value but for now they are hardcoded to what random numbers generated last time for consistancy, the "hash" value is what we should probs use though as its the value in the ggpk
60+
"Nine Lives": {"NodeID": 33600, "GroupID" : 44472},
61+
"Searing Purity": {"NodeID": 22278, "GroupID" : 50933},
62+
"Soul Drinker": {"NodeID": 19264, "GroupID" : 37841, "hash" : 45999},
63+
"Harness the Void": {"GroupID" : 37841},
64+
"Fury of Nature": {"NodeID": 62630, "GroupID" : 56600},
65+
"Fatal Flourish": {"NodeID": 11264, "GroupID" : 63033},
66+
"Indomitable Resolve": {"NodeID": 15386, "GroupID" : 25519},
67+
"Unleashed Potential": {"NodeID": 55193, "GroupID" : 60495},
68+
}
69+
EXTRA_NODES_STATS = { # these should not be hardcoded here, but should by inserted later via the exporter from the ggpk (they are AsendencySpecialEdlritch in PassiveSkills.dat, though reminder text seems to be missing)
70+
"Nine Lives": {"stats": ["25% of Damage taken Recouped as Life, Mana and Energy Shield", "Recoup Effects instead occur over 3 seconds"], "reminderText": ["(Only Damage from Hits can be Recouped, over 4 seconds following the Hit)"]},
71+
"Searing Purity": {"stats": ["45% of Chaos Damage taken as Fire Damage", "45% of Chaos Damage taken as Lightning Damage"], "reminderText": []},
72+
"Soul Drinker": {"stats": ["2% of Damage Leeched as Energy Shield", "20% increased Attack and Cast Speed while Leeching Energy Shield", "Energy Shield Leech effects are not removed when Energy Shield is Filled"], "reminderText": ["(Leeched Energy Shield is recovered over time. Multiple Leeches can occur simultaneously, up to a maximum rate)"]},
73+
"Harness the Void": {"stats": ["27% chance to gain 25% of Non-Chaos Damage with Hits as Extra Chaos Damage", "13% chance to gain 50% of Non-Chaos Damage with Hits as Extra Chaos Damage", "7% chance to gain 100% of Non-Chaos Damage with Hits as Extra Chaos Damage"], "reminderText": []},
74+
"Fury of Nature" : {"stats": ["Non-Damaging Elemental Ailments you inflict spread to nearby enemies in a radius of 20", "Non-Damaging Elemental Ailments you inflict have 100% more Effect"], "reminderText": ["(Elemental Ailments are Ignited, Scorched, Chilled, Frozen, Brittled, Shocked, and Sapped)"]},
75+
"Fatal Flourish": {"stats": ["Final Repeat of Attack Skills deals 60% more Damage", "Non-Travel Attack Skills Repeat an additional Time"], "reminderText": []},
76+
"Indomitable Resolve": {"stats": ["Deal 10% less Damage", "Take 25% less Damage"], "reminderText": []},
77+
"Unleashed Potential" : {"stats": ["400% increased Endurance, Frenzy and Power Charge Duration", "25% chance to gain a Power, Frenzy or Endurance Charge on Kill", "+1 to Maximum Endurance Charges", "+1 to Maximum Frenzy Charges", "+1 to Maximum Power Charges"], "reminderText": []},
78+
}
4379

4480

4581
def fix_ascendancy_positions(path: os.PathLike) -> None:
@@ -70,6 +106,17 @@ def fix_ascendancy_positions(path: os.PathLike) -> None:
70106
offset = NODE_GROUPS[ascendancy] - ascendancy_starting_point[ascendancy]
71107
group["x"] += offset.x
72108
group["y"] += offset.y
109+
for ascendancy in EXTRA_NODES:
110+
for node in EXTRA_NODES[ascendancy]:
111+
if str(EXTRA_NODE_IDS[node["Node"]["name"]]["GroupID"]) in data["groups"]: #using hardcoded value from last time, can use another method instead, like just grabbing the next avalible value
112+
print("GroupID already taken")
113+
return
114+
node["Node"]["group"] = EXTRA_NODE_IDS[node["Node"]["name"]]["GroupID"]
115+
data["groups"][node["Node"]["group"]] = {"x": NODE_GROUPS[ascendancy].x + node["offset"].x, "y": NODE_GROUPS[ascendancy].y + node["offset"].y, "orbits": [0], "nodes": [node["Node"]["skill"]]}
116+
data["nodes"][node["Node"]["skill"]] = node["Node"] | {"ascendancyName": ascendancy, "orbit": 0, "orbitIndex": 0, "out": [], "in": [], "stats": [], "reminderText": []}
117+
if node["Node"]["name"] in EXTRA_NODES_STATS:
118+
data["nodes"][node["Node"]["skill"]]["stats"] = EXTRA_NODES_STATS[node["Node"]["name"]]["stats"]
119+
data["nodes"][node["Node"]["skill"]]["reminderText"] = EXTRA_NODES_STATS[node["Node"]["name"]]["reminderText"]
73120
with open(path, "w", encoding="utf-8") as o:
74121
json.dump(data, o, indent=4)
75122

src/Export/spec.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6686,6 +6686,20 @@ return {
66866686
refTo="PassiveSkillMasteryGroups",
66876687
type="Key",
66886688
width=150
6689+
},
6690+
[32]={
6691+
list=false,
6692+
name="AtlasMastery_rid",
6693+
refTo="",
6694+
type="Key",
6695+
width=150
6696+
},
6697+
[33]={
6698+
list=false,
6699+
name="SoundEffect",
6700+
refTo="SoundEffects",
6701+
type="Key",
6702+
width=150
66896703
}
66906704
},
66916705
PassiveTreeExpansionJewelSizes={

0 commit comments

Comments
 (0)