Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Replace this:
- if (enchantItem.isArmor())
- chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
- // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
- else if (enchantItem.isWeapon())
- {
- if (((L2Weapon) enchantItem.getItem()).isMagical())
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
- else
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
- }
- With that:
- if (isBlessed())
- {
- if (enchantItem.isArmor())
- chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR_BLESSED, (enchantItem.getEnchantLevel() - 2));
- // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
- else if (enchantItem.isWeapon())
- {
- if (((L2Weapon) enchantItem.getItem()).isMagical())
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_MAGIC_BLESSED;
- else
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_BLESSED;
- }
- }
- else if (isCrystal())
- {
- if (enchantItem.isArmor())
- chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR_CRYSTAL, (enchantItem.getEnchantLevel() - 2));
- // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
- else if (enchantItem.isWeapon())
- {
- if (((L2Weapon) enchantItem.getItem()).isMagical())
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_CRYSTAL : Config.ENCHANT_CHANCE_WEAPON_MAGIC_CRYSTAL;
- else
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_CRYSTAL : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_CRYSTAL;
- }
- }
- else
- {
- if (enchantItem.isArmor())
- chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
- // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
- else if (enchantItem.isWeapon())
- {
- if (((L2Weapon) enchantItem.getItem()).isMagical())
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
- else
- chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement