Load rune skill adjusts from rune_skill_adj instead of static_rune_skill_adjusts
Parity (scripts/p27.py): all 2259 DB runes and 69290 rows match in value and order; token = SBStringHash(skill_type), name = obj_name. The JSON adds 95 class/discipline/talent runes; applyRuneSkills reads by mobbase ID and none of them is a mobbase, so no reachable value change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2798d29d0a
commit
0921b031ea
2 files changed
+42
-1
No files matched your search
@@ -8,8 +8,15 @@
|
||||
|
||||
package engine.powers;
|
||||
|
||||
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 RuneSkillAdjustEntry {
|
||||
|
||||
@@ -28,4 +35,37 @@ public class RuneSkillAdjustEntry {
|
||||
this.level = rs.getInt("level");
|
||||
}
|
||||
|
||||
public RuneSkillAdjustEntry(RuneTemplate rune, String skillType, int[] adjust) {
|
||||
this.name = rune.obj_name;
|
||||
this.token = Hasher.SBStringHash(skillType);
|
||||
this.skill_type = skillType;
|
||||
this.rank = adjust[0];
|
||||
this.level = adjust[1];
|
||||
}
|
||||
|
||||
public static HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> loadAllRuneSkillAdjusts() {
|
||||
|
||||
HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> runeSkillAdjusts = new HashMap<>();
|
||||
ArrayList<RuneSkillAdjustEntry> skillAdjustList;
|
||||
int entryCount = 0;
|
||||
|
||||
for (RuneTemplate rune : RuneTemplate._runes.values()) {
|
||||
|
||||
if (rune.rune_skill_adj.isEmpty())
|
||||
continue;
|
||||
|
||||
skillAdjustList = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, ArrayList<int[]>> skillAdjust : rune.rune_skill_adj.entrySet())
|
||||
for (int[] adjust : skillAdjust.getValue())
|
||||
skillAdjustList.add(new RuneSkillAdjustEntry(rune, skillAdjust.getKey(), adjust));
|
||||
|
||||
runeSkillAdjusts.put(rune.template_id, skillAdjustList);
|
||||
entryCount += skillAdjustList.size();
|
||||
}
|
||||
|
||||
Logger.info("Loaded " + entryCount + " skill adjusts for " + runeSkillAdjusts.size() + " runes");
|
||||
return runeSkillAdjusts;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import engine.parsers.cache.RuneParser;
|
||||
import engine.parsers.objects.DeedTemplate;
|
||||
import engine.parsers.objects.ItemTemplate;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.powers.RuneSkillAdjustEntry;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.util.MapLoader;
|
||||
import engine.util.ThreadUtils;
|
||||
@@ -359,7 +360,7 @@ public class WorldServer {
|
||||
PowersManager._allRunePowers = dbRuneBaseHandler.LOAD_RUNE_POWERS();
|
||||
|
||||
Logger.info("Loading Rune Skill Adjusts");
|
||||
PowersManager._allRuneSkillAdjusts = dbRuneBaseHandler.LOAD_RUNE_SKILL_ADJUSTS();
|
||||
PowersManager._allRuneSkillAdjusts = RuneSkillAdjustEntry.loadAllRuneSkillAdjusts();
|
||||
|
||||
Logger.info("Loading item enchants");
|
||||
DbManager.LootQueries.LOAD_ENCHANT_VALUES();
|
||||
|
||||
Reference in new issue
Block a user