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 <noreply@anthropic.com>
This commit is contained in:
1 parent
73947f3dc8
commit
5b3c511b55
3 files changed
+11
-7
No files matched your search
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user