Explorar o código

AutoShots fix:
- Fix for disabling shots on armor equip
- Fix for not disabling shot on S80+ unequip

JIV %!s(int64=15) %!d(string=hai) anos
pai
achega
ced1f51a7a

+ 9 - 6
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -2466,7 +2466,7 @@ public final class L2PcInstance extends L2Playable
 		if (unequipped.getItem().getType2() == L2Item.TYPE2_WEAPON &&
 				(equipped == null ? true : equipped.getItem().getItemGradeSPlus() != unequipped.getItem().getItemGradeSPlus()))
 		{
-			disableAutoShotByCrystalType(unequipped.getItem().getCrystalType());
+			disableAutoShotByCrystalType(unequipped.getItem().getItemGradeSPlus());
 		}
 	}
 	
@@ -2477,11 +2477,14 @@ public final class L2PcInstance extends L2Playable
 		final boolean isEquiped = item.isEquipped();
 		final int oldInvLimit = getInventoryLimit();
 		SystemMessage sm = null;
-		L2ItemInstance old = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);
-		if (old == null)
-			old = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
-		
-		checkSShotsMatch(item, old);
+		if ((item.getItem().getBodyPart() & L2Item.SLOT_MULTI_ALLHAND) != 0)
+		{
+			L2ItemInstance old = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND);
+			if (old == null)
+				old = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
+			
+			checkSShotsMatch(item, old);
+		}
 		
 		if (isEquiped)
 		{

+ 2 - 0
L2_GameServer/java/com/l2jserver/gameserver/templates/item/L2Item.java

@@ -96,6 +96,8 @@ public abstract class L2Item
 	public static final int SLOT_BABYPET = -103;
 	public static final int SLOT_GREATWOLF = -104;
 	
+	public static final int SLOT_MULTI_ALLHAND = SLOT_L_HAND | SLOT_LR_HAND | SLOT_R_HAND;
+	
 	public static final int MATERIAL_STEEL = 0x00; // ??
 	public static final int MATERIAL_FINE_STEEL = 0x01; // ??
 	public static final int MATERIAL_BLOOD_STEEL = 0x02; // ??