Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Armor formula : 0.66^(current-2), chance is lower and lower for each enchant.
- + 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 (((Weapon) 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 (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 (((Weapon) 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;
- }
- }
- return chance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement