diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index f75be68b09..e7e28992ac 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 4d8ff47fc3..5efbe1a603 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 4d8ff47fc3..5efbe1a603 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 4d8ff47fc3..5efbe1a603 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 4502a4fd1b..2f070a92a4 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 4502a4fd1b..2f070a92a4 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 67d3bad410..221b73c891 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -320,12 +320,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 30188e5fba..e8a4f7d6ff 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -320,12 +320,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index c6565b4638..dcd32a1f19 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 30188e5fba..e8a4f7d6ff 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -320,12 +320,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index f75be68b09..e7e28992ac 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index f75be68b09..e7e28992ac 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 131f882c9b..92ca7ff0e7 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 131f882c9b..92ca7ff0e7 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -318,12 +318,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 30188e5fba..e8a4f7d6ff 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -320,12 +320,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 30188e5fba..e8a4f7d6ff 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -320,12 +320,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index a1e03076ca..8592a7024d 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -319,12 +319,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java index 0c7149edb7..448718720a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/AbstractEnchantItem.java @@ -39,6 +39,7 @@ public abstract class AbstractEnchantItem EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM, EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP, EtcItemType.BLESS_ENCHT_AM, + EtcItemType.BLESS_ENCHT_AM_DOWN, EtcItemType.BLESS_ENCHT_WP, EtcItemType.ENCHT_AM, EtcItemType.ENCHT_WP, @@ -56,6 +57,7 @@ public abstract class AbstractEnchantItem private final int _id; private final CrystalType _grade; + private final int _minEnchantLevel; private final int _maxEnchantLevel; private final double _bonusRate; @@ -71,6 +73,7 @@ public abstract class AbstractEnchantItem throw new IllegalAccessError(); } _grade = set.getEnum("targetGrade", CrystalType.class, CrystalType.NONE); + _minEnchantLevel = set.getInt("maxEnchant", 0); _maxEnchantLevel = set.getInt("maxEnchant", 127); _bonusRate = set.getDouble("bonusRate", 0); } @@ -112,6 +115,14 @@ public abstract class AbstractEnchantItem */ public abstract boolean isWeapon(); + /** + * @return the minimum enchant level that this scroll/item can be used with + */ + public int getMinEnchantLevel() + { + return _minEnchantLevel; + } + /** * @return the maximum enchant level that this scroll/item can be used with */ @@ -139,7 +150,7 @@ public abstract class AbstractEnchantItem { return false; } - else if ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel)) + else if (((_minEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() < _minEnchantLevel)) && ((_maxEnchantLevel != 0) && (itemToEnchant.getEnchantLevel() >= _maxEnchantLevel))) { return false; } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java index b8cfd3d575..4abeb649cb 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/enchant/EnchantScroll.java @@ -35,6 +35,7 @@ public class EnchantScroll extends AbstractEnchantItem { private final boolean _isWeapon; private final boolean _isBlessed; + private final boolean _isBlessedDown; private final boolean _isSafe; private final boolean _isGiant; private final int _scrollGroupId; @@ -48,6 +49,7 @@ public class EnchantScroll extends AbstractEnchantItem final ItemType type = getItem().getItemType(); _isWeapon = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_WP); _isBlessed = (type == EtcItemType.BLESS_ENCHT_AM) || (type == EtcItemType.BLESS_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP); + _isBlessedDown = (type == EtcItemType.BLESS_ENCHT_AM_DOWN); _isSafe = (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_ANCIENT_CRYSTAL_ENCHANT_WP) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_AM) || (type == EtcItemType.ENCHT_ATTR_CRYSTAL_ENCHANT_WP); _isGiant = (type == EtcItemType.GIANT_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_WP); } @@ -59,13 +61,21 @@ public class EnchantScroll extends AbstractEnchantItem } /** - * @return {@code true} for blessed scrolls (enchanted item will remain on failure), {@code false} otherwise + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will reset to 0), {@code false} otherwise */ public boolean isBlessed() { return _isBlessed; } + /** + * @return {@code true} for blessed scrolls (enchanted item will remain on failure and enchant value will go down by 1), {@code false} otherwise + */ + public boolean isBlessedDown() + { + return _isBlessedDown; + } + /** * @return {@code true} for safe-enchant scrolls (enchant level will remain on failure), {@code false} otherwise */ @@ -123,6 +133,10 @@ public class EnchantScroll extends AbstractEnchantItem { return false; } + else if ((isBlessedDown() && !supportItem.isBlessed()) || (!isBlessedDown() && supportItem.isBlessed())) + { + return false; + } else if ((isGiant() && !supportItem.isGiant()) || (!isGiant() && supportItem.isGiant())) { return false; diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java index e77da9b82e..b352bd7fc0 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/type/EtcItemType.java @@ -46,6 +46,7 @@ public enum EtcItemType implements ItemType GIANT_ENCHT_AM, BLESS_ENCHT_WP, BLESS_ENCHT_AM, + BLESS_ENCHT_AM_DOWN, COUPON, ELIXIR, ENCHT_ATTR, diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java index 40336712df..92816f60fd 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/RequestEnchantItem.java @@ -320,12 +320,19 @@ public class RequestEnchantItem implements IClientIncomingPacket player.broadcastUserInfo(); } - if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isBlessed())) + if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed())) { + // blessed enchant - enchant value down by 1 + if (scrollTemplate.isBlessedDown()) + { + item.setEnchantLevel(item.getEnchantLevel() - 1); + } + else // blessed enchant - clear enchant value - client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); - - item.setEnchantLevel(0); + { + client.sendPacket(SystemMessageId.THE_BLESSED_ENCHANT_FAILED_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0); + item.setEnchantLevel(0); + } item.updateDatabase(); client.sendPacket(new EnchantResult(EnchantResult.BLESSED_FAIL, 0, 0)); if (Config.LOG_ITEM_ENCHANTS)