Advertisement
brounlimited

Enchant Config for aCis (Blessed/Crystal Scrolls)

May 9th, 2014
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.09 KB | None | 0 0
  1. Replace this:
  2.  
  3.             if (enchantItem.isArmor())
  4.                 chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
  5.             // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
  6.             else if (enchantItem.isWeapon())
  7.             {
  8.                 if (((L2Weapon) enchantItem.getItem()).isMagical())
  9.                     chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
  10.                 else
  11.                     chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
  12.             }
  13.  
  14. With that:
  15.  
  16.             if (isBlessed())
  17.             {
  18.                 if (enchantItem.isArmor())
  19.                     chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR_BLESSED, (enchantItem.getEnchantLevel() - 2));
  20.                 // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
  21.                 else if (enchantItem.isWeapon())
  22.                 {
  23.                     if (((L2Weapon) enchantItem.getItem()).isMagical())
  24.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_MAGIC_BLESSED;
  25.                     else
  26.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_BLESSED;
  27.                 }
  28.             }
  29.             else if (isCrystal())
  30.             {
  31.                 if (enchantItem.isArmor())
  32.                     chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR_CRYSTAL, (enchantItem.getEnchantLevel() - 2));
  33.                 // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
  34.                 else if (enchantItem.isWeapon())
  35.                 {
  36.                     if (((L2Weapon) enchantItem.getItem()).isMagical())
  37.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_CRYSTAL : Config.ENCHANT_CHANCE_WEAPON_MAGIC_CRYSTAL;
  38.                     else
  39.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_CRYSTAL : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_CRYSTAL;
  40.                 }
  41.             }
  42.             else
  43.             {
  44.                 if (enchantItem.isArmor())
  45.                     chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
  46.                 // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
  47.                 else if (enchantItem.isWeapon())
  48.                 {
  49.                     if (((L2Weapon) enchantItem.getItem()).isMagical())
  50.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
  51.                     else
  52.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
  53.                 }
  54.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement