Skip mob race runes when loading power granted trains
Their item_power_action entries are mob power ranks by level, not trains, and getGrantedTrains only looks up a player's race, class, promotion and runes. RACE runes load only when they are a player Race (static_rune_race). Cuts the table from 379384 entries / 969 powers to 2596 / 925; no value a player can read changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c12d5bde0
commit
d6df01f8f3
1 file changed
+9
-2
@@ -10,6 +10,7 @@
|
||||
package engine.objects;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.util.Hasher;
|
||||
@@ -94,14 +95,19 @@ public class PowerGrantedTrains {
|
||||
return (short) 0;
|
||||
}
|
||||
|
||||
// Trains are power_arguments[0] of the first action; only mob race runes carry more than one.
|
||||
// Trains are power_arguments[0] of the first action. Mob race runes are skipped:
|
||||
// their power actions are mob power ranks by level, not trains.
|
||||
public static void loadGrantedPowers() {
|
||||
|
||||
ConcurrentHashMap<Integer, PowerGrantedTrains> powerGrants = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
int token;
|
||||
int grantCount = 0;
|
||||
|
||||
for (RuneTemplate rune : RuneTemplate._runes.values())
|
||||
for (RuneTemplate rune : RuneTemplate._runes.values()) {
|
||||
|
||||
if (rune.rune_type == mbEnums.RuneType.RACE && Race.getRace(rune.template_id) == null)
|
||||
continue;
|
||||
|
||||
for (Map.Entry<String, ArrayList<int[]>> powerAction : rune.item_power_action.entrySet()) {
|
||||
|
||||
if (powerAction.getValue().isEmpty())
|
||||
@@ -112,6 +118,7 @@ public class PowerGrantedTrains {
|
||||
.addRuneGrant(rune.template_id, (short) powerAction.getValue().get(0)[0]);
|
||||
grantCount++;
|
||||
}
|
||||
}
|
||||
|
||||
PowerGrantedTrains.grantedPowers = powerGrants;
|
||||
Logger.info("Loaded " + grantCount + " power train grants for " + powerGrants.size() + " powers");
|
||||
|
||||
Reference in new issue
Block a user