2026-07-26 19:08:44 -04:00
|
|
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
|
|
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
|
|
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
|
|
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
|
|
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
|
|
|
// Magicbane Emulator Project © 2013 - 2026
|
|
|
|
|
// https://www.magicbane.com
|
2023-09-03 09:48:37 -04:00
|
|
|
|
2023-09-02 12:47:04 -04:00
|
|
|
package engine.powers;
|
|
|
|
|
|
2026-10-22 08:18:51 -04:00
|
|
|
import engine.parsers.objects.PowerGrant;
|
|
|
|
|
import engine.parsers.objects.RuneTemplate;
|
|
|
|
|
import engine.util.Hasher;
|
|
|
|
|
import org.pmw.tinylog.Logger;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
2023-09-02 12:47:04 -04:00
|
|
|
|
|
|
|
|
public class RunePowerEntry {
|
|
|
|
|
|
|
|
|
|
public String name;
|
|
|
|
|
public int token;
|
|
|
|
|
public String power_type;
|
|
|
|
|
public int rank;
|
|
|
|
|
|
|
|
|
|
|
2026-10-22 08:18:51 -04:00
|
|
|
public RunePowerEntry(RuneTemplate rune, PowerGrant powerGrant) {
|
|
|
|
|
this.name = rune.obj_name;
|
|
|
|
|
this.token = Hasher.SBStringHash(powerGrant.power_type);
|
|
|
|
|
this.power_type = powerGrant.power_type;
|
|
|
|
|
this.rank = powerGrant.power_value;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-24 12:34:02 -04:00
|
|
|
public RunePowerEntry(String name, String powerType, int rank) {
|
|
|
|
|
this.name = name;
|
|
|
|
|
this.token = Hasher.SBStringHash(powerType);
|
|
|
|
|
this.power_type = powerType;
|
|
|
|
|
this.rank = rank;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Guard captain contract powers have no rune; they live on mbEnums.MinionType
|
|
|
|
|
public static HashMap<Integer, ArrayList<RunePowerEntry>> loadAllRunePowers() {
|
2026-10-22 08:18:51 -04:00
|
|
|
|
|
|
|
|
HashMap<Integer, ArrayList<RunePowerEntry>> runePowers = new HashMap<>();
|
|
|
|
|
ArrayList<RunePowerEntry> powerList;
|
|
|
|
|
int entryCount = 0;
|
|
|
|
|
|
|
|
|
|
for (RuneTemplate rune : RuneTemplate._runes.values()) {
|
|
|
|
|
|
|
|
|
|
if (rune.item_power_grant.isEmpty())
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
powerList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for (PowerGrant powerGrant : rune.item_power_grant)
|
|
|
|
|
powerList.add(new RunePowerEntry(rune, powerGrant));
|
|
|
|
|
|
|
|
|
|
runePowers.put(rune.template_id, powerList);
|
|
|
|
|
entryCount += powerList.size();
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-24 12:34:02 -04:00
|
|
|
Logger.info("Loaded " + entryCount + " rune powers for " + runePowers.size() + " runes");
|
2026-10-22 08:18:51 -04:00
|
|
|
return runePowers;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-02 12:47:04 -04:00
|
|
|
}
|