Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P Game
- Index: java/realtek/gameserver/network/clientpackets/RequestEnchantItem.java
- ===================================================================
- --- java/realtek/gameserver/network/clientpackets/RequestEnchantItem.java (revision 681)
- +++ java/realtek/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.DONATOR_ENCH_RATES && !activeChar.isDonator())
- {
- - 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_DONATOR;
- + break;
- + }
- }
- - }
- - for (int scrollId : CRYSTAL_SCROLLS)
- + for (int scrollId : CRYSTAL_SCROLLS)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + chance = Config.ENCHANT_CHANCE_WEAPON_CRYSTAL_DONATOR;
- + ;
- + break;
- + }
- + }
- + for (int scrollId : BLESSED_SCROLLS)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + chance = Config.ENCHANT_CHANCE_WEAPON_BLESSED_DONATOR;
- + 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_DONATOR;
- + break;
- + }
- }
- - }
- - for (int scrollId : BLESSED_SCROLLS)
- + for (int scrollId : CRYSTAL_SCROLLS)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL_DONATOR;
- + break;
- + }
- + }
- + for (int scrollId : BLESSED_SCROLLS)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED_DONATOR;
- + 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_DONATOR;
- + break;
- + }
- }
- + for (int scrollId : CRYSTAL_SCROLLS)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + chance = Config.ENCHANT_CHANCE_JEWELRY_CRYSTAL_DONATOR;
- + break;
- + }
- + }
- + for (int scrollId : BLESSED_SCROLLS)
- + {
- + if (scroll.getItemId() == scrollId)
- + {
- + chance = Config.ENCHANT_CHANCE_JEWELRY_BLESSED_DONATOR;
- + break;
- + }
- + }
- }
- }
- Index: java/realtek/Config.java
- ===================================================================
- --- java/realtek/Config.java (revision 699)
- +++ java/realtek/Config.java (working copy)
- @@ -832,6 +832,16 @@
- public static boolean DONATOR_TITLE_COLOR_ENABLED;
- public static int DONATOR_NAME_COLOR;
- public static int DONATOR_TITLE_COLOR;
- + public static boolean DONATOR_ENCH_RATES;
- + public static int ENCHANT_CHANCE_WEAPON_DONATOR;
- + public static int ENCHANT_CHANCE_ARMOR_DONATOR;
- + public static int ENCHANT_CHANCE_JEWELRY_DONATOR;
- + public static int ENCHANT_CHANCE_WEAPON_CRYSTAL_DONATOR;
- + public static int ENCHANT_CHANCE_ARMOR_CRYSTAL_DONATOR;
- + public static int ENCHANT_CHANCE_JEWELRY_CRYSTAL_DONATOR;
- + public static int ENCHANT_CHANCE_WEAPON_BLESSED_DONATOR;
- + public static int ENCHANT_CHANCE_ARMOR_BLESSED_DONATOR;
- + public static int ENCHANT_CHANCE_JEWELRY_BLESSED_DONATOR;
- /** Flood Protector */
- public static final FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM = new FloodProtectorConfig("UseItemFloodProtector");
- @@ -1929,10 +1939,20 @@
- Donator.load(is);
- is.close();
- - DONATOR_NAME_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorNameColorEnabled", "False"));
- - DONATOR_TITLE_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorTitleColorEnabled", "False"));
- - DONATOR_NAME_COLOR = Integer.decode("0x" + Donator.getProperty("DonatorColorName", "00FFFF"));
- + DONATOR_NAME_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorNameColorEnabled", "False"));
- + DONATOR_TITLE_COLOR_ENABLED = Boolean.parseBoolean(Donator.getProperty("DonatorTitleColorEnabled", "False"));
- + DONATOR_NAME_COLOR = Integer.decode("0x" + Donator.getProperty("DonatorColorName", "00FFFF"));
- DONATOR_TITLE_COLOR = Integer.decode("0x" + Donator.getProperty("DonatorTitleColor", "00FF00"));
- + DONATOR_ENCH_RATES = Boolean.parseBoolean(Donator.getProperty("DonatorNameColorEnabled", "False"));
- + ENCHANT_CHANCE_WEAPON_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceWeaponDonator", "68"));
- + ENCHANT_CHANCE_ARMOR_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceArmorDonator", "52"));
- + ENCHANT_CHANCE_JEWELRY_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceJewelryDonator", "54"));
- + ENCHANT_CHANCE_WEAPON_CRYSTAL_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceWeaponCrystalDonator", "68"));
- + ENCHANT_CHANCE_ARMOR_CRYSTAL_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceArmorCrystalDonator", "52"));
- + ENCHANT_CHANCE_JEWELRY_CRYSTAL_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceJewelryCrystalDonator", "54"));
- + ENCHANT_CHANCE_WEAPON_BLESSED_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceWeaponBlessedDonator", "68"));
- + ENCHANT_CHANCE_ARMOR_BLESSED_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceArmorBlessedDonator", "52"));
- + ENCHANT_CHANCE_JEWELRY_BLESSED_DONATOR = Integer.parseInt(Donator.getProperty("EnchantChanceJewelryBlessedDonator", "54"));
- }
- catch (Exception e)
- {
- Index: Settings/Modifications/Donator.ini
- ===================================================================
- --- Settings/Modifications/Donator.ini (revision 682)
- +++ Settings/Modifications/Donator.ini (working copy)
- @@ -27,3 +27,26 @@
- # Buffslots
- # Default: 24
- DonatorBuffs = 24
- +
- +
- +# --------------------------- #
- +# Donator Bonuses #
- +# --------------------------- #
- +# Modification Control
- +# Default: Disabled
- +EnableDonatorEnchRates = False
- +
- +# Chance of success to enchant an item for donator. [Normal]
- +EnchantChanceWeaponDonator = 68
- +EnchantChanceArmorDonator = 52
- +EnchantChanceJewelryDonator = 54
- +
- +# Chance of success to enchant an item for donator. [Crystal]
- +EnchantChanceWeaponCrystalDonator = 68
- +EnchantChanceArmorCrystalDonator = 52
- +EnchantChanceJewelryCrystalDonator = 54
- +
- +# Chance of success to enchant an item for donator. [Blessed]
- +EnchantChanceWeaponBlessedDonator = 68
- +EnchantChanceArmorBlessedDonator = 52
- +EnchantChanceJewelryBlessedDonator = 54
Advertisement
Add Comment
Please, Sign In to add comment