Support for royal save card.
Contributed by Sero.
This commit is contained in:
@@ -39,10 +39,11 @@ 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,
|
||||
EtcItemType.ENCHT_WP_DOWN,
|
||||
EtcItemType.ENCHT_AM_DOWN,
|
||||
EtcItemType.GIANT_ENCHT_AM,
|
||||
EtcItemType.GIANT_ENCHT_WP,
|
||||
EtcItemType.ENCHT_ATTR_INC_PROP_ENCHT_AM,
|
||||
|
@@ -37,7 +37,6 @@ 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;
|
||||
@@ -51,7 +50,6 @@ 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);
|
||||
}
|
||||
@@ -70,14 +68,6 @@ 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
|
||||
*/
|
||||
@@ -135,10 +125,6 @@ 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;
|
||||
|
@@ -27,6 +27,7 @@ public class EnchantSupportItem extends AbstractEnchantItem
|
||||
{
|
||||
private final boolean _isWeapon;
|
||||
private final boolean _isBlessed;
|
||||
private final boolean _isDown;
|
||||
private final boolean _isGiant;
|
||||
private final ItemType type;
|
||||
|
||||
@@ -34,8 +35,9 @@ public class EnchantSupportItem extends AbstractEnchantItem
|
||||
{
|
||||
super(set);
|
||||
type = getItem().getItemType();
|
||||
_isWeapon = (type == EtcItemType.ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP);
|
||||
_isWeapon = (type == EtcItemType.ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.ENCHT_WP_DOWN) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP);
|
||||
_isBlessed = (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP);
|
||||
_isDown = (type == EtcItemType.ENCHT_AM_DOWN) || (type == EtcItemType.ENCHT_WP_DOWN);
|
||||
_isGiant = (type == EtcItemType.GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_AM) || (type == EtcItemType.BLESSED_GIANT_ENCHT_ATTR_INC_PROP_ENCHT_WP);
|
||||
}
|
||||
|
||||
@@ -50,6 +52,11 @@ public class EnchantSupportItem extends AbstractEnchantItem
|
||||
return _isBlessed;
|
||||
}
|
||||
|
||||
public boolean isDown()
|
||||
{
|
||||
return _isDown;
|
||||
}
|
||||
|
||||
public boolean isGiant()
|
||||
{
|
||||
return _isGiant;
|
||||
|
@@ -42,11 +42,12 @@ public enum EtcItemType implements ItemType
|
||||
MATURECROP,
|
||||
ENCHT_WP,
|
||||
ENCHT_AM,
|
||||
ENCHT_AM_DOWN,
|
||||
ENCHT_WP_DOWN,
|
||||
GIANT_ENCHT_WP,
|
||||
GIANT_ENCHT_AM,
|
||||
BLESS_ENCHT_WP,
|
||||
BLESS_ENCHT_AM,
|
||||
BLESS_ENCHT_AM_DOWN,
|
||||
COUPON,
|
||||
ELIXIR,
|
||||
ENCHT_ATTR,
|
||||
@@ -71,7 +72,6 @@ public enum EtcItemType implements ItemType
|
||||
SOULSHOT,
|
||||
SHAPE_SHIFTING_WP,
|
||||
BLESS_SHAPE_SHIFTING_WP,
|
||||
// EIT_RESTORE_SHAPE_SHIFTING_WP,
|
||||
SHAPE_SHIFTING_WP_FIXED,
|
||||
SHAPE_SHIFTING_AM,
|
||||
BLESS_SHAPE_SHIFTING_AM,
|
||||
|
@@ -198,7 +198,18 @@ public class RequestEnchantItem implements IClientIncomingPacket
|
||||
}
|
||||
else
|
||||
{
|
||||
item.setEnchantLevel(item.getEnchantLevel() + 1);
|
||||
if (((supportTemplate != null) && (supportTemplate.getId() == 80501)) || ((supportTemplate != null) && (supportTemplate.getId() == 81697))) // Save ticket gold
|
||||
{
|
||||
item.setEnchantLevel(Math.min(item.getEnchantLevel() + 1 + Rnd.get(3), scrollTemplate.getMaxEnchantLevel()));
|
||||
}
|
||||
else if (((supportTemplate != null) && (supportTemplate.getId() == 80449)) || ((supportTemplate != null) && (supportTemplate.getId() == 81698))) // Save ticket black
|
||||
{
|
||||
item.setEnchantLevel(Math.min(item.getEnchantLevel() + 1 + Rnd.get(2), scrollTemplate.getMaxEnchantLevel()));
|
||||
}
|
||||
else
|
||||
{
|
||||
item.setEnchantLevel(item.getEnchantLevel() + 1);
|
||||
}
|
||||
}
|
||||
item.updateDatabase();
|
||||
}
|
||||
@@ -319,10 +330,10 @@ public class RequestEnchantItem implements IClientIncomingPacket
|
||||
player.broadcastUserInfo();
|
||||
}
|
||||
|
||||
if (scrollTemplate.isBlessed() || scrollTemplate.isBlessedDown() || ((supportTemplate != null) && supportTemplate.isBlessed()))
|
||||
if (scrollTemplate.isBlessed() || ((supportTemplate != null) && supportTemplate.isDown()) || ((supportTemplate != null) && supportTemplate.isBlessed()))
|
||||
{
|
||||
// blessed enchant - enchant value down by 1
|
||||
if (scrollTemplate.isBlessedDown())
|
||||
if (((supportTemplate != null) && supportTemplate.isDown()))
|
||||
{
|
||||
item.setEnchantLevel(item.getEnchantLevel() - 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user