mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-17 04:54:42 +02:00
Straightening up our Managers more, also fixed a few bugs regarding
unlock levels and Deflect not working properly.
This commit is contained in:
@ -612,12 +612,8 @@ public class SkillUtils {
|
||||
return chance > Misc.getRandom().nextInt(activationChance);
|
||||
}
|
||||
|
||||
public static boolean activationSuccessful(Player player, SkillType skill, double chance) {
|
||||
return chance > Misc.getRandom().nextInt(PerksUtils.handleLuckyPerks(player, skill));
|
||||
}
|
||||
|
||||
public static boolean unlockLevelReached(Player player, SkillType skill, int unlockLevel) {
|
||||
return UserManager.getPlayer(player).getProfile().getSkillLevel(skill) > unlockLevel;
|
||||
public static boolean activationSuccessful(int skillLevel, int activationChance, double maxChance, int maxLevel) {
|
||||
return ((maxChance / maxLevel) * Math.min(skillLevel, maxLevel)) > Misc.getRandom().nextInt(activationChance);
|
||||
}
|
||||
|
||||
public static boolean treasureDropSuccessful(double dropChance, int activationChance) {
|
||||
|
Reference in New Issue
Block a user