Explorar o código

fix: Made crystallize button appear with correct skill

The crystallize button in the inventory was appearing when a character had the Create Item skill, rather than the Crystallize skill.
This was due to a flag being set in the UserInfo packet based on L2PcInstance#hasDwarvenCraft().
Introduced a canCrystallize() method on L2PcInstance to drive the flag instead.
Noe Caratini %!s(int64=3) %!d(string=hai) anos
pai
achega
5d3d480425

+ 4 - 0
src/main/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -1553,6 +1553,10 @@ public final class L2PcInstance extends L2Playable {
 	public int getCommonCraft() {
 		return getSkillLevel(CommonSkill.CREATE_COMMON.getId());
 	}
+
+	public boolean canCrystallize() {
+		return getSkillLevel(CommonSkill.CRYSTALLIZE.getId()) >= 1;
+	}
 	
 	/**
 	 * @return the PK counter of the L2PcInstance.

+ 1 - 1
src/main/java/com/l2jserver/gameserver/network/serverpackets/UserInfo.java

@@ -176,7 +176,7 @@ public final class UserInfo extends L2GameServerPacket {
 		writeD(_relation);
 		writeC(_activeChar.getMountType().ordinal()); // mount type
 		writeC(_activeChar.getPrivateStoreType().getId());
-		writeC(_activeChar.hasDwarvenCraft() ? 1 : 0);
+		writeC(_activeChar.canCrystallize() ? 1 : 0); // This drives the Crystallize button appearing in the inventory
 		writeD(_activeChar.getPkKills());
 		writeD(_activeChar.getPvpKills());