Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: config/head/enchant.properties
- ===================================================================
- --- config/head/enchant.properties (revision 923)
- +++ config/head/enchant.properties (working copy)
- @@ -46,6 +46,19 @@
- # Jewel
- CrystalJewelryEnchantLevel = 1,100;2,100;3,100;4,97;5,94;6,91;7,88;8,85;9,82;10,79;11,76;12,73;13,70;14,67;15,64;16,61;
- +# ---------------------------------------------
- +# Chance For Donator Scrolls -
- +# ---------------------------------------------
- +# Weapon
- +DonatorWeaponEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,10;17,10;18,10;19,10;20,10;
- +# Armor
- +DonatorArmorEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,100;17,100;18,100;19,100;20,100;
- +# Jewel
- +DonatorJewelryEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,100;17,100;18,100;19,100;20,100;
- +
- +# Enchant after break with donator scroll.
- +DonatorEnchantAfterBreak = 3
- +
- # Safe enchant
- EnchantSafeMax = 3
- EnchantSafeMaxFull = 4
- Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 923)
- +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
- @@ -40,6 +40,10 @@
- public final class RequestEnchantItem extends L2GameClientPacket
- {
- protected static final Logger _log = Logger.getLogger(Inventory.class.getName());
- +
- + private static final int[] DONATOR_WEAPON_SCROLL= { 10000 };
- + private static final int[] DONATOR_ARMOR_SCROLL = { 10001 };
- +
- private static final int[] CRYSTAL_SCROLLS =
- {
- 731, 732, 949, 950, 953, 954, 957, 958, 961, 962
- @@ -154,6 +158,7 @@
- int itemType2 = item.getItem().getType2();
- boolean enchantItem = false;
- boolean blessedScroll = false;
- + boolean donatorScroll = false;
- boolean crystalScroll = false;
- int crystalId = 0;
- @@ -167,6 +172,7 @@
- case 729:
- case 731:
- case 6569:
- + case 10000:
- if(itemType2 == L2Item.TYPE2_WEAPON)
- {
- enchantItem = true;
- @@ -175,6 +181,7 @@
- case 730:
- case 732:
- case 6570:
- + case 10001:
- if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
- {
- enchantItem = true;
- @@ -189,6 +196,7 @@
- case 947:
- case 949:
- case 6571:
- + case 10000:
- if(itemType2 == L2Item.TYPE2_WEAPON)
- {
- enchantItem = true;
- @@ -197,6 +205,7 @@
- case 948:
- case 950:
- case 6572:
- + case 10001:
- if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
- {
- enchantItem = true;
- @@ -211,6 +220,7 @@
- case 951:
- case 953:
- case 6573:
- + case 10000:
- if(itemType2 == L2Item.TYPE2_WEAPON)
- {
- enchantItem = true;
- @@ -219,6 +229,7 @@
- case 952:
- case 954:
- case 6574:
- + case 10001:
- if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
- {
- enchantItem = true;
- @@ -233,6 +244,7 @@
- case 955:
- case 957:
- case 6575:
- + case 10000:
- if(itemType2 == L2Item.TYPE2_WEAPON)
- {
- enchantItem = true;
- @@ -241,6 +253,7 @@
- case 956:
- case 958:
- case 6576:
- + case 10001:
- if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
- {
- enchantItem = true;
- @@ -255,6 +268,7 @@
- case 959:
- case 961:
- case 6577:
- + case 10000:
- if(itemType2 == L2Item.TYPE2_WEAPON)
- {
- enchantItem = true;
- @@ -263,6 +277,7 @@
- case 960:
- case 962:
- case 6578:
- + case 10001:
- if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
- {
- enchantItem = true;
- @@ -283,6 +298,10 @@
- {
- blessedScroll = true;
- }
- + else if(scroll.getItemId() == 10000 || scroll.getItemId() == 10001)
- + {
- + donatorScroll = true;
- + }
- else
- {
- for(int crystalscroll : CRYSTAL_SCROLLS)
- @@ -350,6 +369,24 @@
- }
- }
- + }else if(donatorScroll){
- +
- + for (int scrollId : DONATOR_WEAPON_SCROLL)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + if(item.getEnchantLevel() >= Config.DONATOR_WEAPON_ENCHANT_LEVEL.size())
- + {
- + chance = Config.DONATOR_WEAPON_ENCHANT_LEVEL.get(Config.DONATOR_WEAPON_ENCHANT_LEVEL.size());
- + }
- + else
- + {
- + chance = Config.DONATOR_WEAPON_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
- + }
- + maxEnchantLevel = Config.ENCHANT_WEAPON_MAX;
- + break;
- + }
- + }
- }else{ //normal scrolls
- for(int normalweaponscroll : NORMAL_WEAPON_SCROLLS)
- @@ -416,6 +453,25 @@
- }
- }
- + }else if(donatorScroll){
- +
- + for (int scrollId : DONATOR_ARMOR_SCROLL)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + if(item.getEnchantLevel() >= Config.DONATOR_ARMOR_ENCHANT_LEVEL.size())
- + {
- + chance = Config.DONATOR_ARMOR_ENCHANT_LEVEL.get(Config.DONATOR_ARMOR_ENCHANT_LEVEL.size());
- + }
- + else
- + {
- + chance = Config.DONATOR_ARMOR_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
- + }
- + maxEnchantLevel = Config.ENCHANT_ARMOR_MAX;
- +
- + break;
- + }
- + }
- }else{ //normal scrolls
- for(int normalarmorscroll : NORMAL_ARMOR_SCROLLS)
- @@ -482,6 +538,25 @@
- }
- }
- + }else if(donatorScroll){
- +
- + for (int scrollId : DONATOR_ARMOR_SCROLL)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + if(item.getEnchantLevel() >= Config.DONATOR_JEWELRY_ENCHANT_LEVEL.size())
- + {
- + chance = Config.DONATOR_JEWELRY_ENCHANT_LEVEL.get(Config.DONATOR_JEWELRY_ENCHANT_LEVEL.size());
- + }
- + else
- + {
- + chance = Config.DONATOR_JEWELRY_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
- + }
- + maxEnchantLevel = Config.ENCHANT_JEWELRY_MAX;
- +
- + break;
- + }
- + }
- }else{
- for(int normaljewelscroll : NORMAL_ARMOR_SCROLLS)
- @@ -585,6 +660,9 @@
- }else if(blessedScroll){
- sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
- activeChar.sendPacket(sm);
- + }else if(donatorScroll){
- + sm = SystemMessage.sendString("Failed in Donator Enchant. The enchant value of the item become " + Config.DONATOR_ENCHANT_AFTER_BREAK + ".");
- + activeChar.sendPacket(sm);
- }else{
- if(item.getEnchantLevel() > 0)
- {
- @@ -601,7 +679,7 @@
- }
- }
- - if(!blessedScroll && !crystalScroll)
- + if(!blessedScroll && !crystalScroll && !donatorScroll)
- {
- if(item.getEnchantLevel() > 0)
- {
- @@ -693,9 +771,10 @@
- }else if(crystalScroll){
- item.setEnchantLevel(Config.CRYSTAL_ENCHANT_MIN);
- item.updateDatabase();
- + }else if(donatorScroll){
- + item.setEnchantLevel(Config.DONATOR_ENCHANT_AFTER_BREAK);
- + item.updateDatabase();
- }
- -
- -
- }
- }
- }
- Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java (revision 923)
- +++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java (working copy)
- @@ -54,8 +54,9 @@
- 961,
- 962,
- 6577,
- - 6578
- - // s grade
- + 6578, // s grade
- + 10000,
- + 10001 // Donator Scroll
- };
- @Override
- Index: head-src/com/l2jfrozen/Config.java
- ===================================================================
- --- head-src/com/l2jfrozen/Config.java (revision 923)
- +++ head-src/com/l2jfrozen/Config.java (working copy)
- @@ -2772,15 +2776,20 @@
- public static FastMap<Integer, Integer> NORMAL_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> BLESS_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> CRYSTAL_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- + public static FastMap<Integer, Integer> DONATOR_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> NORMAL_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> BLESS_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> CRYSTAL_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- + public static FastMap<Integer, Integer> DONATOR_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> NORMAL_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> BLESS_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- public static FastMap<Integer, Integer> CRYSTAL_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- + public static FastMap<Integer, Integer> DONATOR_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
- + public static int DONATOR_ENCHANT_AFTER_BREAK;
- +
- public static int ENCHANT_SAFE_MAX;
- public static int ENCHANT_SAFE_MAX_FULL;
- public static int ENCHANT_WEAPON_MAX;
- @@ -2915,6 +2924,32 @@
- }
- }
- + propertySplit = ENCHANTSetting.getProperty("DonatorWeaponEnchantLevel", "").split(";");
- + for(String readData : propertySplit)
- + {
- + String[] writeData = readData.split(",");
- + if(writeData.length != 2)
- + {
- + System.out.println("invalid config property");
- + }
- + else
- + {
- + try
- + {
- + DONATOR_WEAPON_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
- + }
- + catch(NumberFormatException nfe)
- + {
- + if(Config.ENABLE_ALL_EXCEPTIONS)
- + nfe.printStackTrace();
- + if(!readData.equals(""))
- + {
- + System.out.println("invalid config property");
- + }
- + }
- + }
- + }
- +
- propertySplit = ENCHANTSetting.getProperty("NormalArmorEnchantLevel", "").split(";");
- for(String readData : propertySplit)
- {
- @@ -2993,6 +3028,32 @@
- }
- }
- + propertySplit = ENCHANTSetting.getProperty("DonatorArmorEnchantLevel", "").split(";");
- + for(String readData : propertySplit)
- + {
- + String[] writeData = readData.split(",");
- + if(writeData.length != 2)
- + {
- + System.out.println("invalid config property");
- + }
- + else
- + {
- + try
- + {
- + DONATOR_ARMOR_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
- + }
- + catch(NumberFormatException nfe)
- + {
- + if(Config.ENABLE_ALL_EXCEPTIONS)
- + nfe.printStackTrace();
- + if(!readData.equals(""))
- + {
- + System.out.println("invalid config property");
- + }
- + }
- + }
- + }
- +
- propertySplit = ENCHANTSetting.getProperty("NormalJewelryEnchantLevel", "").split(";");
- for(String readData : propertySplit)
- {
- @@ -3075,6 +3136,35 @@
- }
- }
- + propertySplit = ENCHANTSetting.getProperty("DonatorJewelryEnchantLevel", "").split(";");
- + for(String readData : propertySplit)
- + {
- + String[] writeData = readData.split(",");
- + if(writeData.length != 2)
- + {
- + System.out.println("invalid config property");
- + }
- + else
- + {
- + try
- + {
- + DONATOR_JEWELRY_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
- + }
- + catch(NumberFormatException nfe)
- + {
- + if(Config.ENABLE_ALL_EXCEPTIONS)
- + nfe.printStackTrace();
- +
- + if(!readData.equals(""))
- + {
- + System.out.println("invalid config property");
- + }
- + }
- + }
- + }
- +
- + DONATOR_ENCHANT_AFTER_BREAK = Integer.parseInt(ENCHANTSetting.getProperty("DonatorEnchantAfterBreak", "3"));
- +
- /** limit of safe enchant normal **/
- ENCHANT_SAFE_MAX = Integer.parseInt(ENCHANTSetting.getProperty("EnchantSafeMax", "3"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement