Jump to content

[Share]Enchant rates For Heroes.


'Baggos'

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...