Merge pull request #353 from Glitchfinder/master

Reimplementing Skill Level and Power Level caps.
This commit is contained in:
Glitchfinder 2012-12-26 19:56:44 -08:00
commit bd1850db69
2 changed files with 7 additions and 1 deletions

View File

@ -345,7 +345,10 @@ public class Config extends ConfigLoader {
public int getLevelCapTaming() { return config.getInt("Skills.Taming.Level_Cap", 0); } public int getLevelCapTaming() { return config.getInt("Skills.Taming.Level_Cap", 0); }
public int getLevelCapUnarmed() { return config.getInt("Skills.Unarmed.Level_Cap", 0); } public int getLevelCapUnarmed() { return config.getInt("Skills.Unarmed.Level_Cap", 0); }
public int getLevelCapWoodcutting() { return config.getInt("Skills.Woodcutting.Level_Cap", 0); } public int getLevelCapWoodcutting() { return config.getInt("Skills.Woodcutting.Level_Cap", 0); }
public int getPowerLevelCap() { return config.getInt("General.Power_Level_Cap", 0); } public int getPowerLevelCap() {
int cap = config.getInt("General.Power_Level_Cap", 0);
return ((cap == 0) ? Integer.MAX_VALUE : cap);
}
/* PVP & PVE Settings */ /* PVP & PVE Settings */
public boolean getAcrobaticsPVP() { return config.getBoolean("Skills.Acrobatics.Enabled_For_PVP", true); } public boolean getAcrobaticsPVP() { return config.getBoolean("Skills.Acrobatics.Enabled_For_PVP", true); }

View File

@ -533,6 +533,9 @@ public class Skills {
if(Users.getPlayer(player) == null) if(Users.getPlayer(player) == null)
return; return;
if((type.getMaxLevel() < profile.getSkillLevel(type) + 1) || (Misc.getPowerLevelCap() < Users.getPlayer(player).getPowerLevel() + 1))
return;
Users.getPlayer(player).addXP(type, xp); Users.getPlayer(player).addXP(type, xp);
xpCheckSkill(type, player, profile); xpCheckSkill(type, player, profile);
} }