Mark summoned pets with MASK_PET
Summoned pets (not necro pets) now carry MASK_PET, so pet-targeted AOE powers can find them. The checkForAggro pet scan is held off with PET_AGGRO_ENABLED until it checks rune enemy lists, filters targets and keeps pet targets (plan-mask-pet.md steps 2-4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5262a602da
commit
40799f96f6
2 files changed
+12
-1
No files matched your search
@@ -44,6 +44,11 @@ public class MobAI {
|
|||||||
//
|
//
|
||||||
// CombatManager.class implements shared combat routines for all avatars.
|
// CombatManager.class implements shared combat routines for all avatars.
|
||||||
|
|
||||||
|
// Pet aggro scan in checkForAggro stays off until it checks rune enemy lists,
|
||||||
|
// filters its targets and keeps pet targets (MBDATA/docs/plan-mask-pet.md steps 2-4).
|
||||||
|
|
||||||
|
private static final boolean PET_AGGRO_ENABLED = false;
|
||||||
|
|
||||||
private static void attackTarget(Mob mob, AbstractWorldObject target) {
|
private static void attackTarget(Mob mob, AbstractWorldObject target) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -629,7 +634,7 @@ public class MobAI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aiAgent.getCombatTarget() == null) {
|
if (PET_AGGRO_ENABLED && aiAgent.getCombatTarget() == null) {
|
||||||
|
|
||||||
//look for pets to aggro if no players found to aggro
|
//look for pets to aggro if no players found to aggro
|
||||||
|
|
||||||
|
|||||||
@@ -552,6 +552,12 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
|||||||
|
|
||||||
petMinion.despawned = false;
|
petMinion.despawned = false;
|
||||||
petMinion.runAfterLoad();
|
petMinion.runAfterLoad();
|
||||||
|
|
||||||
|
// Summoned pets carry MASK_PET. Necro pets keep their own NecroPet handling.
|
||||||
|
|
||||||
|
if (!petMinion.isNecroPet())
|
||||||
|
petMinion.setObjectTypeMask(petMinion.getObjectTypeMask() | MBServerStatics.MASK_PET);
|
||||||
|
|
||||||
DbManager.addToCache(petMinion);
|
DbManager.addToCache(petMinion);
|
||||||
petMinion.setLoc(petMinion.bindLoc);
|
petMinion.setLoc(petMinion.bindLoc);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user