Advertisement
Guest User

Blessed

a guest
Feb 1st, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1.             // Armor formula : 0.66^(current-2), chance is lower and lower for each enchant.
  2. +           if (isBlessed())
  3. +           {
  4. +               if (enchantItem.isArmor())
  5. +                   chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR_BLESSED, (enchantItem.getEnchantLevel() - 2));
  6. +               // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
  7. +               else if (enchantItem.isWeapon())
  8. +               {
  9. +                   if (((Weapon) enchantItem.getItem()).isMagical())
  10. +                       chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_MAGIC_BLESSED;
  11. +                   else
  12. +                       chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_BLESSED;
  13. +               }
  14. +           }
  15.             else
  16.             {
  17.                 if (enchantItem.isArmor())
  18.                     chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
  19.                 // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
  20.                 else if (enchantItem.isWeapon())
  21.                 {
  22.                     if (((Weapon) enchantItem.getItem()).isMagical())
  23.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
  24.                     else
  25.                         chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
  26.                 }
  27.             }
  28.            
  29.             return chance;
  30.         }
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement