Load trainer max skills from talent rune_skill_adj instead of static_rune_maxskills

Parity (scripts/p27.py): all 78 DB runes match (token, skillLevel = pair
level, maxSkillPercent = pair rank). Talents only, as decided in Task 2.7:
class/discipline/race adjusts are skill grants, and contracts whose class
ID is such a rune (Thief, Huntress, Warlock, Fighter, 8 disciplines,
Vampire) would otherwise gain trainer caps.
The selector adds Brawler 250054 and guard talents 252621-252623; no
contract keys on them, so no reachable value change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-22 07:46:18 -04:00
1 parent 0921b031ea
commit e3aae0af5c
2 files changed
+30 -1

No files matched your search

+29
View File
@@ -9,10 +9,16 @@
package engine.objects;
import engine.mbEnums;
import engine.parsers.objects.RuneTemplate;
import engine.util.Hasher;
import org.pmw.tinylog.Logger;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class MaxSkills {
@@ -42,6 +48,29 @@ public class MaxSkills {
this.maxSkillPercent = maxSkillPercent;
}
public static void LoadAllMaxSkills() {
ArrayList<MaxSkills> maxSkillsList;
int entryCount = 0;
// Talents only: class/discipline/race adjusts are skill grants, and contracts that key on those runes would read them as caps
for (RuneTemplate rune : RuneTemplate._runes.values()) {
if (rune.rune_type != mbEnums.RuneType.TALENT || rune.rune_skill_adj.isEmpty())
continue;
maxSkillsList = new ArrayList<>();
for (Map.Entry<String, ArrayList<int[]>> skillAdjust : rune.rune_skill_adj.entrySet())
for (int[] adjust : skillAdjust.getValue())
maxSkillsList.add(new MaxSkills(rune.template_id, Hasher.SBStringHash(skillAdjust.getKey()), adjust[1], adjust[0]));
MaxSkillsSet.put(rune.template_id, maxSkillsList);
entryCount += maxSkillsList.size();
}
Logger.info("Loaded " + entryCount + " max skills for " + MaxSkillsSet.size() + " runes");
}
public int getRuneID() {
return runeID;
}
+1 -1
View File
@@ -461,7 +461,7 @@ public class WorldServer {
Runegate.loadAllRunegates();
Logger.info("Loading Max Skills for Trainers");
DbManager.SkillsBaseQueries.LOAD_ALL_MAX_SKILLS_FOR_CONTRACT();
MaxSkills.LoadAllMaxSkills();
//pick a startup Hotzone
ZoneManager.generateAndSetRandomHotzone();