Addition of BLESS_ENCHT_AM_DOWN support.
Contributed by CostyKiller.
This commit is contained in:
@@ -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,
|
||||
|
@@ -37,6 +37,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;
|
||||
@@ -50,6 +51,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);
|
||||
}
|
||||
@@ -68,6 +70,14 @@ public class EnchantScroll extends AbstractEnchantItem
|
||||
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
|
||||
*/
|
||||
|
@@ -48,6 +48,7 @@ public enum EtcItemType implements ItemType
|
||||
GIANT_ENCHT_AM,
|
||||
BLESS_ENCHT_WP,
|
||||
BLESS_ENCHT_AM,
|
||||
BLESS_ENCHT_AM_DOWN,
|
||||
COUPON,
|
||||
ELIXIR,
|
||||
ENCHT_ATTR,
|
||||
|
@@ -312,11 +312,12 @@ public class RequestEnchantItem implements IClientIncomingPacket
|
||||
player.broadcastUserInfo();
|
||||
}
|
||||
|
||||
if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isDown()) || ((supportTemplate != null) && supportTemplate.isBlessed()))
|
||||
if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isDown()) || ((supportTemplate != null) && supportTemplate.isBlessed()))
|
||||
{
|
||||
// blessed enchant - enchant value down by 1
|
||||
if (((supportTemplate != null) && supportTemplate.isDown()))
|
||||
if (scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isDown()))
|
||||
{
|
||||
client.sendPacket(SystemMessageId.THE_ENCHANT_VALUE_IS_DECREASED_BY_1);
|
||||
item.setEnchantLevel(item.getEnchantLevel() - 1);
|
||||
}
|
||||
else // blessed enchant - clear enchant value
|
||||
|
Reference in New Issue
Block a user