Files
Server/src/engine/objects/RuneBaseAttribute.java
T
MagicBotandClaude Opus 5.5 64a86152d3 Load rune bases from all non-RACE runes, dropping static_rune_runebase reads
The 315 static_rune_runebase rows are exactly the non-RACE runes, so the loader
selects by rune_type. Removes the server type/subtype columns (no live reader),
the runereq/overwrite path, the GET_RUNEBASE cache-miss query, the runebase
attribute handler, the racerune/baseclassrune loaders and the 111111 checks.
No value changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 12:36:34 -04:00

95 lines
3.0 KiB
Java

// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2026
// https://www.magicbane.com
package engine.objects;
import engine.mbEnums;
import engine.parsers.objects.RuneTemplate;
import engine.server.MBServerStatics;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
public class RuneBaseAttribute extends AbstractGameObject {
public static HashMap<Integer, ArrayList<RuneBaseAttribute>> runeBaseAttributeMap = new HashMap<>();
private short attributeID;
private short modValue;
/**
* No Table ID Constructor
*/
public RuneBaseAttribute(short attributeID, short modValue) {
super();
this.attributeID = attributeID;
this.modValue = modValue;
}
/**
* Normal
*/
public RuneBaseAttribute(short attributeID, short modValue, int newUUID) {
super(newUUID);
this.attributeID = attributeID;
this.modValue = modValue;
}
// Attribute ids: 0 = rune_creation_cost, 1-5 = rune_attr_adj, 6-10 = rune_max_attr_adj,
// 11-15 = item_attr_req; the AttributeType ordinals Strength..Spirit are 1-5.
public static ArrayList<RuneBaseAttribute> getAttributesForRune(RuneTemplate rune) {
ArrayList<RuneBaseAttribute> attributes = new ArrayList<>();
if (rune.rune_creation_cost != 0)
attributes.add(new RuneBaseAttribute((short) MBServerStatics.RUNE_COST_ATTRIBUTE_ID, (short) rune.rune_creation_cost));
addAttributes(attributes, rune.rune_attr_adj, 0);
addAttributes(attributes, rune.rune_max_attr_adj, 5);
addAttributes(attributes, rune.item_attr_req, 10);
return attributes;
}
private static void addAttributes(ArrayList<RuneBaseAttribute> attributes, EnumMap<mbEnums.AttributeType, Integer> values, int idOffset) {
for (mbEnums.AttributeType attributeType : values.keySet()) {
if (values.get(attributeType) == 0)
continue;
attributes.add(new RuneBaseAttribute((short) (attributeType.ordinal() + idOffset), values.get(attributeType).shortValue()));
}
}
/*
* Getters
*/
public short getAttributeID() {
return attributeID;
}
public short getModValue() {
return modValue;
}
/*
* Utils
*/
@Override
public void updateDatabase() {
// TODO Auto-generated method stub
}
}