// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . // ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // 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> 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 getAttributesForRune(RuneTemplate rune) { ArrayList 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 attributes, EnumMap 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 } }