Jump to content

Recommended Posts

Posted

Hello members of maxcheaters. This code i use on my server!

 

Index: java/l2network/gameserver/network/clientpackets/RequestEnchantItem.java
======
--- java/l2network/gameserver/network/clientpackets/RequestEnchantItem.java       (revision 681)
+++ java/l2network/gameserver/network/clientpackets/RequestEnchantItem.java       (working copy)
@@ -205,87 +205,177 @@
                SystemMessage sm;
                int chance = 0;
                int maxEnchantLevel = 0;
-               if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
+
+               if (!Config.HEROES_ENCHANT_RATES && !activeChar.isHero())
                {
-                       maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
-                       for (int scrollId : ENCHANT_SCROLLS)
+                       if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
                        {
-                               if (scroll.getItemId() == scrollId)
+                               maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
+                               for (int scrollId : ENCHANT_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_WEAPON;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_WEAPON;
+                                               break;
+                                       }
                                }
-                       }
-                       for (int scrollId : CRYSTAL_SCROLLS)
-                       {
-                               if (scroll.getItemId() == scrollId)
+                               for (int scrollId : CRYSTAL_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL;
-                                       ;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL;
+                                               ;
+                                               break;
+                                       }
                                }
-                       }
-                       for (int scrollId : BLESSED_SCROLLS)
-                       {
-                               if (scroll.getItemId() == scrollId)
+                               for (int scrollId : BLESSED_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED;
+                                               break;
+                                       }
                                }
-                       }
-               } else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
-               {
-                       maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
-                       for (int scrollId : ENCHANT_SCROLLS)
+                       } else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
                        {
-                               if (scroll.getItemId() == scrollId)
+                               maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
+                               for (int scrollId : ENCHANT_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_ARMOR;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_ARMOR;
+                                               break;
+                                       }
                                }
-                       }
-                       for (int scrollId : CRYSTAL_SCROLLS)
-                       {
-                               if (scroll.getItemId() == scrollId)
+                               for (int scrollId : CRYSTAL_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL;
+                                               break;
+                                       }
                                }
-                       }
-                       for (int scrollId : BLESSED_SCROLLS)
+                               for (int scrollId : BLESSED_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED;
+                                               break;
+                                       }
+                               }
+                       } else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
                        {
-                               if (scroll.getItemId() == scrollId)
+                               maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
+                               for (int scrollId : ENCHANT_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_JEWELRY;
+                                               break;
+                                       }
                                }
+                               for (int scrollId : CRYSTAL_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL;
+                                               break;
+                                       }
+                               }
+                               for (int scrollId : BLESSED_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED;
+                                               break;
+                                       }
+                               }
                        }
-               } else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
+               }
+               else
                {
-                       maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
-                       for (int scrollId : ENCHANT_SCROLLS)
+                       if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
                        {
-                               if (scroll.getItemId() == scrollId)
+                               maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
+                               for (int scrollId : ENCHANT_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_JEWELRY;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_WEAPON_HEROES;
+                                               break;
+                                       }
                                }
-                       }
-                       for (int scrollId : CRYSTAL_SCROLLS)
+                               for (int scrollId : CRYSTAL_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL_HEROES;
+                                               ;
+                                               break;
+                                       }
+                               }
+                               for (int scrollId : BLESSED_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED_HEROES;
+                                               break;
+                                       }
+                               }
+                       } else if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
                        {
-                               if (scroll.getItemId() == scrollId)
+                               maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
+                               for (int scrollId : ENCHANT_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_ARMOR_HEROES;
+                                               break;
+                                       }
                                }
-                       }
-                       for (int scrollId : BLESSED_SCROLLS)
+                               for (int scrollId : CRYSTAL_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL_HEROES;
+                                               break;
+                                       }
+                               }
+                               for (int scrollId : BLESSED_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED_HEROES;
+                                               break;
+                                       }
+                               }
+                       } else if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
                        {
-                               if (scroll.getItemId() == scrollId)
+                               maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
+                               for (int scrollId : ENCHANT_SCROLLS)
                                {
-                                       chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED;
-                                       break;
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_JEWELRY_HEROES;
+                                               break;
+                                       }
                                }
+                               for (int scrollId : CRYSTAL_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL_HEROES;
+                                               break;
+                                       }
+                               }
+                               for (int scrollId : BLESSED_SCROLLS)
+                               {
+                                       if (scroll.getItemId() == scrollId)
+                                       {
+                                               chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED_HEROES;
+                                               break;
+                                       }
+                               }
                        }
                }

=====
--- java/l2network/Config.java

+       public static boolean              HEROES_ENCHANT_RATES;
+       public static int                  ENCHANT_CHANCE_WEAPON_HEROES;
+    public static int                  ENCHANT_CHANCE_ARMOR_HEROES;
+    public static int                  ENCHANT_CHANCE_JEWELRY_HEROES;
+    public static int                  ENCHANT_CHANCE_WEAPON_CRYSTAL_HEROES;
+    public static int                  ENCHANT_CHANCE_ARMOR_CRYSTAL_HEROES;
+    public static int                  ENCHANT_CHANCE_JEWELRY_CRYSTAL_HEROES;
+    public static int                  ENCHANT_CHANCE_WEAPON_BLESSED_HEROES;
+    public static int                  ENCHANT_CHANCE_ARMOR_BLESSED_HEROES;
+    public static int                  ENCHANT_CHANCE_JEWELRY_BLESSED_HEROES;



+               HEROES_ENCHANT_RATES                           = Boolean.parseBoolean(Donator.getProperty("CustomHeroesEnchantRates", "False"));
+               ENCHANT_CHANCE_WEAPON_HEROES                = Integer.parseInt(Donator.getProperty("ChanceWeaponForHero", "75"));
+                ENCHANT_CHANCE_ARMOR_HEROES                 = Integer.parseInt(Donator.getProperty("ChanceArmornForHero", "75"));
+                ENCHANT_CHANCE_JEWELRY_HEROES               = Integer.parseInt(Donator.getProperty("ChanceJewelsForHero", "75"));
+                ENCHANT_CHANCE_WEAPON_CRYSTAL_HEROES        = Integer.parseInt(Donator.getProperty("CrystalChanceWeaponForHero", "100"));
+                ENCHANT_CHANCE_ARMOR_CRYSTAL_HEROES         = Integer.parseInt(Donator.getProperty("CrystalChanceArmorForHero", "100"));
+                ENCHANT_CHANCE_JEWELRY_CRYSTAL_HEROES       = Integer.parseInt(Donator.getProperty("CrystalChanceJewelsForHero", "100"));
+                ENCHANT_CHANCE_WEAPON_BLESSED_HEROES        = Integer.parseInt(Donator.getProperty("BlessedChanceWeaponForHero", "100"));
+                ENCHANT_CHANCE_ARMOR_BLESSED_HEROES         = Integer.parseInt(Donator.getProperty("BlessedChanceArmorForHero", "100"));
+                ENCHANT_CHANCE_JEWELRY_BLESSED_HEROES       = Integer.parseInt(Donator.getProperty("BlessedChanceJewelsForHero", "100"));

 

======

config:
+
+# --------------------------- #
+# Enchant Rates For Heroes
+# --------------------------- #
+CustomHeroesEnchantRates = False
+
+# Normal chance of success to enchant an item for heroes.
+ChanceWeaponForHero = 75
+ChanceArmorForHero = 75
+ChanceJewelsForHero = 75
+
+# Crystal chance of success to enchant an item for heroes.
+CrystalChanceWeaponForHero = 100
+CrystalChanceArmorForHero = 100
+CrystalChanceJewelsForHero = 100
+
+# Blessed chance of success to enchant an item for heroes.
+Blessed ChanceWeaponForHero = 100
+Blessed ChanceArmorForHero = 100
+Blessed ChanceJewelsForHero = 100

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..