From 5b3c511b5597a5788e62c2a36fa8d918fbf05103 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Oct 2026 14:23:41 -0400 Subject: [PATCH] Read item eq slots from the cache template isTwoHanded, validForSlot, getSwingAnimation and the mob equipment set read getItemEqSlotsOr/And, which drop the exporter's NONE. Offline parity (p15c.py, 7586 rows): 0 differences once NONE is ignored. Value changes: - validForSlot: items whose only slot is NONE no longer pass for slot NONE. - getSwingAnimation: the 7 slotless weapons (Rock 19297, Arrow 25650, siege ammo 29000/29010/29020/29030/29350) return the default 75 instead of indexing their empty left-hand anim list. - MobBase equipment sets skip slotless items instead of keying them under NONE. No EQUIP booty entry references one (the 104 sets that do are ITEM booty sets). Co-Authored-By: Claude Opus 5.5 --- src/engine/gameManager/CombatManager.java | 6 +++--- src/engine/gameManager/ItemManager.java | 6 +++--- src/engine/objects/MobBase.java | 6 +++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 266c8a4e..05ec8844 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -596,7 +596,7 @@ public enum CombatManager { } //Item has no equipment slots and should not try to return an animation, return default instead - if (wb.item_eq_slots_or == null || wb.item_eq_slots_or.isEmpty()) { + if (wb.cacheTemplate.getItemEqSlotsOr().isEmpty()) { return 75; } @@ -605,8 +605,8 @@ public enum CombatManager { int random; //Item can only be equipped in one slot, return animation for that slot - if (wb.item_eq_slots_or.size() == 1) { - if (wb.item_eq_slots_or.iterator().next().equals(mbEnums.EquipSlotType.RHELD)) { + if (wb.cacheTemplate.getItemEqSlotsOr().size() == 1) { + if (wb.cacheTemplate.getItemEqSlotsOr().iterator().next().equals(mbEnums.EquipSlotType.RHELD)) { anim = weapon.weapon_attack_anim_right.get(0)[0]; if (dpj != null) { random = ThreadLocalRandom.current().nextInt(weapon.weapon_attack_anim_right.size()); diff --git a/src/engine/gameManager/ItemManager.java b/src/engine/gameManager/ItemManager.java index ac97103d..640f7fd2 100644 --- a/src/engine/gameManager/ItemManager.java +++ b/src/engine/gameManager/ItemManager.java @@ -95,7 +95,7 @@ public enum ItemManager { if (!item.template.cacheTemplate.getItemType().equals(mbEnums.ItemType.WEAPON)) return false; - return item.template.item_eq_slots_and.containsAll(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD)); + return item.template.cacheTemplate.getItemEqSlotsAnd().containsAll(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD)); } public static boolean isTwoHanded(ItemTemplate template) { @@ -103,7 +103,7 @@ public enum ItemManager { if (!template.cacheTemplate.getItemType().equals(mbEnums.ItemType.WEAPON)) return false; - return template.item_eq_slots_and.containsAll(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD)); + return template.cacheTemplate.getItemEqSlotsAnd().containsAll(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD)); } public static boolean isShield(Item item) { @@ -130,7 +130,7 @@ public enum ItemManager { return false; //Item not valid for slot - if (item.template.item_eq_slots_or.contains(slot) == false) + if (item.template.cacheTemplate.getItemEqSlotsOr().contains(slot) == false) return false; // Slot is taken diff --git a/src/engine/objects/MobBase.java b/src/engine/objects/MobBase.java index ce6d726a..09671e5d 100644 --- a/src/engine/objects/MobBase.java +++ b/src/engine/objects/MobBase.java @@ -127,9 +127,13 @@ public class MobBase extends AbstractGameObject { for (BootySetEntry equipmentSetEntry : equipList) { Item item = new Item(equipmentSetEntry.templateID); + + if (item.template.cacheTemplate.getItemEqSlotsOr().isEmpty()) + continue; + item.objectUUID = ItemManager.lastNegativeID.decrementAndGet(); item.drop_chance = equipmentSetEntry.dropChance; - item.equipSlot = item.template.item_eq_slots_or.iterator().next(); + item.equipSlot = item.template.cacheTemplate.getItemEqSlotsOr().iterator().next(); equip.put(item.equipSlot, item); }