Enforce MONSTERTYPERESTRICTS on mob targets

static_power_powerbase monsterTypeRestrict1-3 were loaded into
PowersBase.monsterTypeRestrictions but never read. getAllTargets now
drops a Mob whose race rune rune_sub_type is restricted (the rune
sub-type is the client's monster type, g_MonsterTypeEnum at rune +0xC).

86 powers restrict Siege (DB and Powers.cfg agree). Value changes:
- Imbue Golem, Dark Lord's Boon, Strengthen Beast no longer land on the
  Siege-type summons Siege Golem 11999 (ANM-004) and Ice Fiend 11998
  (SUM-005); they still buff the other pets.
- The 83 Siege-restricted harmful powers (bleeds, DOTs, procs, debuffs,
  Challenge, The Lesser Kiss, ...) no longer affect Trebuchet 13171,
  Mangonel 13757, Ballista 13758 or the two Siege summons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-23 15:56:22 -04:00
1 parent 3a9fc2607a
commit 86d78a55a9
1 file changed
+25
+25
View File
@@ -28,6 +28,7 @@ import engine.net.Dispatch;
import engine.net.client.ClientConnection;
import engine.net.client.msg.*;
import engine.objects.*;
import engine.parsers.objects.RuneTemplate;
import engine.parsers.objects.wpak.PowerTemplate;
import engine.powers.*;
import engine.powers.poweractions.AbstractPowerAction;
@@ -1284,6 +1285,20 @@ public enum PowersManager {
return false;
}
// MONSTERTYPERESTRICTS: a target's monster type is its race rune's rune_sub_type (client g_MonsterTypeEnum, rune +0xC)
private static boolean isRestrictedMonsterType(AbstractWorldObject target, PowersBase pb) {
RuneTemplate raceRune = null;
if (target == null || pb.monsterTypeRestrictions.isEmpty())
return false;
if (target.getObjectType() == GameObjectType.Mob)
raceRune = RuneTemplate._runes.get(((Mob) target).getMobBaseID());
return raceRune != null && pb.monsterTypeRestrictions.contains(raceRune.rune_sub_type);
}
public static void sendRecyclePower(int token, ClientConnection origin) {
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(token);
@@ -1720,6 +1735,11 @@ public enum PowersManager {
continue;
}
if (isRestrictedMonsterType(awo, pb)) {
awolist.remove();
continue;
}
if (awo != null && awo.getObjectType().equals(GameObjectType.PlayerCharacter)) {
// Remove players who are in safe mode
@@ -1869,6 +1889,11 @@ public enum PowersManager {
continue;
}
if (isRestrictedMonsterType(awo, pb)) {
awolist.remove();
continue;
}
if (awo != null && awo.getObjectType().equals(GameObjectType.PlayerCharacter)) {
// Remove players who are in safe mode
PlayerCharacter pcc = (PlayerCharacter) awo;