Move guard captain powers from static_rune_powers to MinionType

The 14 Magister Captain contracts' powers have no client rune or deed
(Task 3.9), so they live on the MinionType mage entries instead of the
DB fallback in loadAllRunePowers. canCast, mobCast and aiInfoCmd read
them through MinionType.getCaptainPowers.

No value change: same 56 power ids, rank 40, and all 56 DB tokens equal
the powerbase token of their power id (checked on mbdb_108).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-24 12:34:02 -04:00
1 parent b0460ed2d0
commit dff53d5c76
5 files changed
+51 -39

No files matched your search

+33 -15
View File
@@ -18,6 +18,7 @@ import engine.objects.AbstractCharacter;
import engine.objects.Shrine;
import engine.objects.Zone;
import engine.powers.EffectsBase;
import engine.powers.RunePowerEntry;
import org.pmw.tinylog.Logger;
import java.util.ArrayList;
@@ -2633,55 +2634,61 @@ public class mbEnums {
public enum MinionType {
AELFBORNGUARD(951, 1637, MinionClass.MELEE, "Guard", "Aelfborn"),
AELFBORNMAGE(952, 1635, MinionClass.MAGE, "Adept", "Aelfborn"),
AELFBORNMAGE(952, 1635, MinionClass.MAGE, "Adept", "Aelfborn", "WIZ-016", "WIZ-061", "WIZ-025", "WIZ-020"),
AMAZONGUARD(1500, 1670, MinionClass.MELEE, "Guard", "Amazon"),
AMAZONMAGE(1502, 1638, MinionClass.MAGE, "Fury", "Amazon"),
AMAZONMAGE(1502, 1638, MinionClass.MAGE, "Fury", "Amazon", "FUR-003", "FUR-011", "FUR-009", "FUR-005"),
ARACOIXGUARD(1600, 1672, MinionClass.MELEE, "Guard", "Aracoix"), //used guard captain equipset.
ARACOIXMAGE(1602, 885, MinionClass.MAGE, "Adept", "Aracoix"),
ARACOIXMAGE(1602, 885, MinionClass.MAGE, "Adept", "Aracoix", "WLR-029", "WLR-019", "WLR-027", "WLR-012"),
CENTAURGUARD(1650, 1642, MinionClass.MELEE, "Guard", "Centaur"),
CENTAURMAGE(1652, 1640, MinionClass.MAGE, "Druid", "Centaur"),
CENTAURMAGE(1652, 1640, MinionClass.MAGE, "Druid", "Centaur", "PRL-017", "PRL-046", "PRL-033", "PRL-009"),
DWARVENARCHER(845, 1644, MinionClass.ARCHER, "Marksman", "Dwarven"),
DWARVENGUARD(1050, 1666, MinionClass.MELEE, "Guard", "Dwarven"),
DWARVENMAGE(1052, 1643, MinionClass.MAGE, "War Priest", "Dwarven"),
DWARVENMAGE(1052, 1643, MinionClass.MAGE, "War Priest", "Dwarven", "PRL-017", "PRL-046", "PRL-033", "PRL-009"),
ELFGUARD(1180, 1671, MinionClass.MELEE, "Guard", "Elven"), //old 1645
ELFMAGE(1182, 1667, MinionClass.MAGE, "Adept", "Elven"),
ELFMAGE(1182, 1667, MinionClass.MAGE, "Adept", "Elven", "WIZ-020", "WIZ-025", "WIZ-016", "WIZ-061"),
FORESTGUARD(1550, 1668, MinionClass.MELEE, "Guard", "Forest"), //captain changed to guard equipset
FORESTMAGE(1552, 436, MinionClass.MAGE, "Adept", "Forest"),
FORESTMAGE(1552, 436, MinionClass.MAGE, "Adept", "Forest", "DRU-009", "DRU-023", "DRU-036", "DRU-015"),
HOLYGUARD(1525, 1658, MinionClass.MELEE, "Guard", "Holy Church"),
HOLYMAGE(1527, 1646, MinionClass.MAGE, "Prelate", "Holy Church"),
HOLYMAGE(1527, 1646, MinionClass.MAGE, "Prelate", "Holy Church", "PRL-017", "PRL-046", "PRL-033", "PRL-009"),
HUMANARCHER(846, 1654, MinionClass.ARCHER, "Archer", "Human"),
HUMANGUARD(840, 1665, MinionClass.MELEE, "Guard", "Human"),
HUMANMAGE(848, 1655, MinionClass.MAGE, "Adept", "Human"),
HUMANMAGE(848, 1655, MinionClass.MAGE, "Adept", "Human", "WIZ-016", "WIZ-025", "WIZ-020", "WIZ-061"),
IREKEIGUARD(1350, 1659, MinionClass.MELEE, "Guard", "Irekei"),
IREKEIMAGE(1352, 1660, MinionClass.MAGE, "Adept", "Irekei"),
IREKEIMAGE(1352, 1660, MinionClass.MAGE, "Adept", "Irekei", "WIZ-061", "WIZ-016", "WIZ-025", "WIZ-020"),
MINOTAURARCHER(1701, 0, MinionClass.ARCHER, "Archer", "Minotaur"),
MINOTAURGUARD(1700, 1673, MinionClass.MELEE, "Guard", "Minotaur"),
NORTHMANGUARD(1250, 1669, MinionClass.MELEE, "Guard", "Northman"),
NORTHMANMAGE(1252, 1650, MinionClass.MAGE, "Runecaster", "Northman"),
NORTHMANMAGE(1252, 1650, MinionClass.MAGE, "Runecaster", "Northman", "WIZ-061", "WIZ-016", "WIZ-025", "WIZ-020"),
SHADEGUARD(1450, 1662, MinionClass.MELEE, "Guard", "Shade"),
SHADEMAGE(1452, 1664, MinionClass.MAGE, "Adept", "Shade"),
SHADEMAGE(1452, 1664, MinionClass.MAGE, "Adept", "Shade", "NEC-001", "NEC-003", "MAG-013", "MAG-025"),
TEMPLARGUARD(841, 1564, MinionClass.MELEE, "Marksman", "Templar"),
TEMPLEGUARD(1575, 1652, MinionClass.MELEE, "Guard", "Temple"),
TEMPLEMAGE(1577, 1656, MinionClass.MAGE, "Confessor", "Temple"),
TEMPLEMAGE(1577, 1656, MinionClass.MAGE, "Confessor", "Temple", "CON-048", "CON-015", "CON-012", "CON-051"),
UNDEADGUARD(980100, 1674, MinionClass.MELEE, "Guard", "Undead"),
UNDEADMAGE(980102, 1675, MinionClass.MAGE, "Adept", "Undead"),
UNDEADMAGE(980102, 1675, MinionClass.MAGE, "Adept", "Undead", "NEC-001", "NEC-003", "MAG-013", "MAG-025"),
WEREWOLFGUARD(980104, 0, MinionClass.MELEE, "Guard", "Werewolf"),
WEREBEARGUARD(980103, 0, MinionClass.MELEE, "Guard", "Werebear");
public static HashMap<Integer, MinionType> ContractToMinionMap = new HashMap<>();
private static final int CAPTAIN_POWER_RANK = 40;
private final int captainContractID;
private final int equipSetID;
private final MinionClass minionClass;
private final String name;
private final String race;
private final ArrayList<RunePowerEntry> captainPowers;
MinionType(int captainContractID, int equipSetID, MinionClass minionClass, String name, String race) {
// Captain powers were hand-made by the server team; no client rune or deed lists them
MinionType(int captainContractID, int equipSetID, MinionClass minionClass, String name, String race, String... captainPowerTypes) {
this.captainContractID = captainContractID;
this.equipSetID = equipSetID;
this.minionClass = minionClass;
this.name = name;
this.race = race;
this.captainPowers = new ArrayList<>();
for (String powerType : captainPowerTypes)
this.captainPowers.add(new RunePowerEntry(race + " " + name, powerType, CAPTAIN_POWER_RANK));
}
public static void InitializeMinions() {
@@ -2690,6 +2697,17 @@ public class mbEnums {
ContractToMinionMap.put(minionType.captainContractID, minionType);
}
// The powers a guard captain's contract casts, shared by its minions; empty for non-caster contracts
public static ArrayList<RunePowerEntry> getCaptainPowers(int captainContractID) {
MinionType minionType = ContractToMinionMap.get(captainContractID);
if (minionType == null)
return new ArrayList<>();
return minionType.captainPowers;
}
public String getName() {
return name;
}