Search in sources :

Example 1 with RewardTable

use of com.archyx.aureliumskills.rewards.RewardTable in project AureliumSkills by Archy-X.

the class PlayerData method getAbilityLevel.

public int getAbilityLevel(Ability ability) {
    Skill skill = ability.getSkill();
    RewardTable rewardTable = plugin.getRewardManager().getRewardTable(skill);
    if (getSkillLevel(ability.getSkill()) < plugin.getAbilityManager().getUnlock(ability)) {
        return 0;
    }
    int level = (getSkillLevel(ability.getSkill()) - plugin.getAbilityManager().getUnlock(ability)) / plugin.getAbilityManager().getLevelUp(ability) + 1;
    // Check max level
    if (level <= plugin.getAbilityManager().getMaxLevel(ability) || plugin.getAbilityManager().getMaxLevel(ability) == 0) {
        return level;
    } else {
        return plugin.getAbilityManager().getMaxLevel(ability);
    }
}
Also used : Skill(com.archyx.aureliumskills.skills.Skill) RewardTable(com.archyx.aureliumskills.rewards.RewardTable)

Aggregations

RewardTable (com.archyx.aureliumskills.rewards.RewardTable)1 Skill (com.archyx.aureliumskills.skills.Skill)1