Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - Parte da config
- +# Enchant level (+) for starter items of characters on creation?
- +# Default = 0
- +NewCharEnchantItems = 6
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index ba3ddff..389d92a 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -568,7 +575,15 @@
- public static int CHAR_CREATE_LVL;
- public static int NEW_CHAR_ENCHANT_LEVEL;
- CHAR_CREATE_LVL = Integer.parseInt(newChar.getProperty("CharLvl", "80"));
- + NEW_CHAR_ENCHANT_LEVEL = newChar.getProperty("NewCharEnchantItems", 0);
- + if (NEW_CHAR_ENCHANT_LEVEL < 0)
- + NEW_CHAR_ENCHANT_LEVEL = 0;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (revision 190)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/CharacterCreate.java (working copy)
- @@ -152,6 +164,8 @@
- if (item.isEquipable() && holder.isEquipped())
- player.getInventory().equipItemAndRecord(item);
- + if (Config.NEW_CHAR_ENCHANT_LEVEL != 0 && item.isEnchantable())
- + item.setEnchantLevel(Config.NEW_CHAR_ENCHANT_LEVEL);
- Index: java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java (revision 190)
- +++ java/net/sf/l2j/gameserver/model/item/instance/ItemInstance.java (working copy)
- @@ -43,8 +43,10 @@
- +import net.sf.l2j.gameserver.model.item.type.CrystalType;
- +import net.sf.l2j.gameserver.model.item.type.WeaponType;
- @@ -470,6 +472,16 @@
- }
- public final int getCrystalCount()
- {
- return _item.getCrystalCount(_enchantLevel);
- }
- + /**
- + * Returns the reference grade of the item.
- + *
- + * @return int
- + */
- + public final CrystalType getItemGrade()
- + {
- + return _item.getCrystalType();
- + }
- +
- + /**
- * @return the reference price of the item.
- */
- public int getReferencePrice()
- @@ -1260,4 +1272,17 @@
- public void unChargeAllShots()
- {
- _shotsMask = 0;
- }
- +
- + /**
- + * @return true if item can be enchanted.
- + */
- + public boolean isEnchantable()
- + {
- + if (isHeroItem() || isShadowItem() || isEtcItem() || (getItemType() == WeaponType.FISHINGROD) || (getItemGrade() == CrystalType.NONE))
- + return false;
- +
- + // only equipped items or in inventory can be enchanted
- + return ((getLocation() == ItemLocation.INVENTORY) || (getLocation() == ItemLocation.PAPERDOLL));
- + }
- +
- }
Add Comment
Please, Sign In to add comment