Update leveling_tools.go to add new allocation of stats and skills
Stat and Skill point allocation updated for leveling characters, when the leveling script option is also set. Stats are done per the d2go order of STR, ENG, DEX and VIT. Which should work well for leveling, reaching gear requirements and mana needs first. Skills are allocated by comparing totals at the current char level. So it's not just allocating skill X at level Y. It takes into account what you've already skilled up.
Testing:
- Tested across characters (sorc & paladin leveling scripts)
- Tested on standard vs. legacy graphics.
- Tested at different char levels, with different stat settings including changing the order, including 0's, ommissions of certain stats.
Things to note:
- Several imports (math, slices, sort, strings) were needed to take character config inputs and manipulate them. I have no idea how inefficient this is, but I used them to turn the character settings into usable data in the for loops, no matter the char level, char settings order, ommissions etc.
I'm not a seasoned coder, so would appreciate feedback in making future PRs easy for you devs. Also appreciate the leveling process in general isn't the main priority but I will be working away at pieces that I use. This PR solves issue #640
The stat and skill assignment is working nicely, but the current code has us putting only into vita until level 20. We need to put some into strength asap so we can equip gear. I recommend at least 34 strength so we can wear a large shield for eventual Ancients Pledge.
Thanks for testing, and agreed re: strength. I’ve intentionally not amended any of the character scripts though whilst making this compatible. They can be class specific and people can amend their own. Theirs separate work being done on auto level/auto equip also, so that’s separate from this PR.
Thanks for testing, and agreed re: strength. I’ve intentionally not amended any of the character scripts though whilst making this compatible. They can be class specific and people can amend their own. Theirs separate work being done on auto level/auto equip also, so that’s separate from this PR.
Good point, I forgot the stat allocation is happening in the specific character go files.
Note: known issue with the skill allocation order being messed up by skill quests. i.e. teleport should be allocated at 18, but if we do the den quest, it should be 19. Will try to amend this to allocate the skill with the highest ID first, so it should allocate more important or new skills first. Instead of leveling nova/fireball etc on leveling chars.
For some reason Nova isn't being binded under the sorceress_leveling_lightning.go. Assuming you already fixed this since you seem to be using the sorc leveling script for lightning.
Yeah the skill binding doesn't seem to work for certain skills, or skills beyond the first 2-3. It also needs updating for the classic graphic settings I think. I'm not sure how the row and column system works so I didn't touch it in this PR though. This is purely the Stat and Skill functions, EnsureStatPoints and EnsureSkillPoints. Tried to keep it minimal for my first PR and try get it into main.
I split the function into two for loops so it first levels all specified skills once, to ensure pre-requisites are met. Then allocates skills based on highest ID first, to ensure better skills or teleport are skilled first. This now fully works whether it's a level 1 char running leveling, a full skill reset allocating all skills, or a char that's part-way leveled already. Tested on normal and legacy graphics. Please note, this has nothing to do with the Skill Binding function. Ready for review. Happy to remove comments that I've left for clearer review, but may be cleaner to remove.